How i can implement the Hot Chocolate GraphQL method versioning similar like to REST, i.e. /graphql/v1 or using request header. i don't want to use Deprecating fields because there is no any change in input or out param but i have change in method implementation(business wise).
Asked
Active
Viewed 527 times
1 Answers
1
GraphQL has no concept of versioning. What you would tend to do is still deprecate and introduce a new method under a new name.
Hot Chocolate can expose multiple schemas though, so you can host two separate schemas on the same server.
services.AddGraphQLServer("a")
services.AddGraphQLServer("b")
in the MapGraphQL
method, you would need to map a specific schema to a specific route.
app.MapGraphQL("/graphql/a", schemaName: "a")
Having multiple versions of the schema will not scale very well and the more you introduce of these the harder it will get.

Michael Ingmar Staib
- 1,721
- 9
- 22
-
Thanks Michael, can we also use the request header instead of schema app.MapGraphQL("/graphql/a", schemaName: "a") – – Mudasser Apr 14 '22 at 08:03
-
We have not added this capability... but in theory, that would also work. We can have a look on adding this for version 13 – Michael Ingmar Staib Apr 15 '22 at 08:35