pendantator/api/src/graphql/accounts.sdl.ts

38 lines
788 B
TypeScript

export const schema = gql`
type Account {
id: String!
address: ContactAddress!
active: Boolean!
PaidUp: Boolean!
contactAddressId: String!
User: User
userId: String
}
type Query {
accounts: [Account!]! @requireAuth
account(id: String!): Account @requireAuth
}
input CreateAccountInput {
active: Boolean!
PaidUp: Boolean!
contactAddressId: String!
userId: String
}
input UpdateAccountInput {
active: Boolean
PaidUp: Boolean
contactAddressId: String
userId: String
}
type Mutation {
createAccount(input: CreateAccountInput!): Account! @requireAuth
updateAccount(id: String!, input: UpdateAccountInput!): Account!
@requireAuth
deleteAccount(id: String!): Account! @requireAuth
}
`