@accounter/server
Version:
Accounter GraphQL server
70 lines (60 loc) • 1.75 kB
text/typescript
import { gql } from 'graphql-modules';
export default gql`
extend type Query {
client(businessId: UUID!): Client!
allClients: [Client!]!
}
extend type Mutation {
updateClient(businessId: UUID!, fields: ClientUpdateInput!): UpdateClientResponse!
(roles: ["business_owner", "accountant"])
insertClient(fields: ClientInsertInput!): UpdateClientResponse!
(roles: ["business_owner", "accountant"])
}
" business extended with green invoice data "
type Client {
id: UUID!
originalBusiness: LtdFinancialEntity!
emails: [String!]!
generatedDocumentType: DocumentType!
integrations: ClientIntegrations!
}
" integrations associated with a client "
type ClientIntegrations {
id: ID!
hiveId: String
linearId: String
slackChannelKey: String
notionId: String
workflowyUrl: String
}
" fields for inserting a new client "
input ClientInsertInput {
businessId: UUID!
emails: [String!]
generatedDocumentType: DocumentType!
integrations: ClientIntegrationsInput
}
" fields for updating an existing client "
input ClientUpdateInput {
newBusinessId: UUID
emails: [String!]
generatedDocumentType: DocumentType
integrations: ClientIntegrationsInput
}
" integrations input for client insert/update "
input ClientIntegrationsInput {
greenInvoiceId: UUID
hiveId: String
linearId: String
slackChannelKey: String
notionId: String
workflowyUrl: String
}
" result type for updateClient "
union UpdateClientResponse = Client | CommonError
extend type LtdFinancialEntity {
clientInfo: Client
}
`;