Database resolvers
#
ResolversResolvers are functions that fetch data based on parameters. Resolves are provided by the user.
#
Required fetch resolversuser(id: ID!): User
Fetches a user based on provided user iduserWithEmail(email: string): User
Fetches a user based on provided user emailannotation(id: ID!): Annotation
Fetches an annotation based on provided annotation iddocument(id: ID!): Document
Fetches a document based on provided document idannotationMember(id: ID!): AnnotationMember
Fetches a member based on provided annotationMember iddocumentMember(id: ID!): DocumentMember
Fetches a member based on provided documentMember id
#
Optional fetch resolversThese resolvers are not required but are recommended for performance reasons. If these resolvers are not defined the app will fall back to the required resolvers, which may be inefficient, as it would require multiple database requests rather than just one.
users(ids: [ID!]!): [User!]!
Fetches a group of users based on provided IDs. Falls back to looping over theuser
resolver if not defined.annotations(ids: [ID!]!): [Annotation!]!
Fetches a group of annotations based on provided IDs. Falls back to looping over theannotation
resolver if not defined.annotationMembers(ids: [ID!]!): [AnnotationMember!]!
Fetches members based on provided annotationMember iddocumentMembers(ids: [ID!]!): [DocumentMember!]!
Fetches members based on provided documentMember iduserDocuments(userId: ID!): [Document]
Fetches all documents belong to provided user
#
MutationsMutations are functions that modify data, they are implemented to cause a data write.
addUser(input: NewUserInput!): User!
: Create a new user.editUser(id: ID!, input: EditUserInput!): StandardUser!
: Edit existing user by user id.deleteUser(id: ID! ): DeleteResult!
: Deactivate existing user by user id. This will change the status of user toINACTIVE
.addAnnotation(input: NewAnnotationInput!): Annotation!
: Create a new annotation.editAnnotation(id:ID!, input: EditAnnotationInput!): Annotation!
: Editing annotation by annotation id.deleteAnnotation(id: ID!, input: DeleteAnnotationInput!): DeleteResult!
: Delete annotation by annotation id, this will also delete all of its annotation members.addAnnotationMember(input: NewAnnotationMemberInput!): AnnotationMember!
: Create new annotation member to link the annotation, the member of the annotation and the document it belong to.editAnnotationMember(id: ID!, input: EditAnnotationMemberInput!): AnnotationMember!
: Edit the annotation member by annotation member iddeleteAnnotationMember(id: ID!): DeleteResult!
: Delete the annotation memberupdateAnnotationMemberLastRead(memberId: ID!): AnnotationMember!
: Update the lastRead timestamp of annotation member.addDocument(document: NewDocumentInput!): Document!
: Create new document.editDocument(id: ID! input: EditDocumentInput): Document!
: Edit document by document id.deleteDocument(id: ID!): DeleteResult!
: Delete document, this will also delete all of its document members.addDocumentMember(input: NewDocumentMemberInput!): DocumentMember!
: Create new document member to link the document and the member of the document.deleteDocumentMember(id: ID!): DeleteResult!
: Delete document member by document member id.updateDocumentMemberLastRead(memberId: ID!): DocumentMember!
: Update the lastRead timestamp of document member.removeDocumentFromUser(documentId: ID!, userId: ID!): User!
: Delete document member by document id and user id.