Hotchocolate: Add documentation for AddType and AddQueryType

Created on 10 Jun 2020  ·  1Comment  ·  Source: ChilliCream/hotchocolate

Hi,

As a developer who wants to use Hot Chocolate, I want to know what is the difference between .AddType and .AddQueryType. I could not find documentation on either method.

Here are the places I looked:

Search results:
image

Docstring comment:
image

❓ question 🌶 hot chocolate 📚 documentation

Most helpful comment

Hi! To explain it better, I made an example to show you the difference. I hope you understand the difference now, and the possibilities.

I use the AddType for the schema definition, like:
So this can be used to describe your schema by every field based on the model. In my example i use the Fluent API definition.

image

And the QueryType for the definition to describe the possible queries, like:
So overhere you can describe the actions that can be done by you GraphQL server.

image

And in the above example you can see the includes of the resolvers, and one of the resolvers looks like the next example:

image

And types and the QueryType i define like the next example:

image

And the result in the GraphQL schema looks like:

Example Schema

>All comments

Hi! To explain it better, I made an example to show you the difference. I hope you understand the difference now, and the possibilities.

I use the AddType for the schema definition, like:
So this can be used to describe your schema by every field based on the model. In my example i use the Fluent API definition.

image

And the QueryType for the definition to describe the possible queries, like:
So overhere you can describe the actions that can be done by you GraphQL server.

image

And in the above example you can see the includes of the resolvers, and one of the resolvers looks like the next example:

image

And types and the QueryType i define like the next example:

image

And the result in the GraphQL schema looks like:

Example Schema

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sergeyshaykhullin picture sergeyshaykhullin  ·  3Comments

tunurgitr picture tunurgitr  ·  4Comments

mortzi picture mortzi  ·  4Comments

benmccallum picture benmccallum  ·  3Comments

sascha-andres picture sascha-andres  ·  4Comments