🌟 Enterprise Feature 🌟 This feature is bundled with GraphQL-Enterprise.

Installing Changesets

Changesets require some updates to the schema (to define changesets) and some updates to your controller (to receive version headers from clients).

Schema Setup

To get started with GraphQL-Enterprise Changesets, you have to add them to your schema. They’re added in several places:

Once those integrations are set up, you’re ready to write a changeset and start releasing API versions!

Controller Setup

Additionally, your controller must pass context[:changeset_version] when running queries. To provide this, update your controller:

class GraphqlController < ApplicationController
  def execute
    context = {
      # ...
      changeset_version: headers["API-Version"], # <- Your header here. Choose something for API clients to pass.
    }
    result = MyAppSchema.execute(..., context: context)
    # ...
  end
end

In the example above, API-Version: ... will be parsed from the incoming request and used as context[:changeset_version].

If context[:changeset_version] is nil, then no changesets will apply to that request.

Now that Changesets are installed, read on to define some changesets.