0

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).

Mudasser
  • 29
  • 2

1 Answers1

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.