Skip to content

Annotation based mutation sample in the docs #4705

Discussion options

You must be logged in to vote

While "Annotation-based" implies the usage of an attribute, in this example it only means we are not using Code-first APIs such as a descriptor and ObjectType. In general you can think of "Annotation-based" as "I write regular classes/records and sprinkle in some Hot Chocolate functionality using attributes when necessary".

To explain the example: The class "Mutation" represents a GraphQL object type of the same name with a field called "addBook". The method called "AddBook" is what computes the value for said field.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wondering639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants