Skip to main content

Schema Publishing

IMPORTANT: Schema publishing is only applicable for Federated Schema, not Single Schema configurations.

When inigo apply is run on a Gateway or Subgraph, a new version of the composed schema is automatically created, as documented in Federated Schema. Yet, the new composed schema is not yet published meaning that it's not pushed down to the Inigo Agent installed in Apollo Gateway or Apollo Router.

The inigo publish command will trigger the publishing of the composed schema. The publishing process also depends on a Schema Registry to store the composed schema. The Inigo cloud provides an internal Schema Registry that's used by default, but you can optionally deploy a Private Schema Registry.

Once the composed schema is published, the Inigo agent (running in Gateway or Router) will be notified so the updated composed schema can be downloaded and dynamically applied. Different versions of the schema can be published making it easy to roll back a failed deployment.

Note: inigo publish requires a configurator role to run.

Note: To run Apollo Gateway or Apollo Router with the Inigo Agent, a published version of the composed schema must be available in the Schema Registry.

Publish a Composed Schema

Publishing the currently composed schema for the demo application can be done with the following command:

inigo publish apollo-gateway-fed-2-demo:dev

The expected output when you publish the composed schema is shown in this example:

Schema v4 published successfully!

Roll Back To a Prior Schema Version

It is possible to republish a prior version of a schema. This may be useful in instances where a schema has errors or a publishing mistake was made, and rolling back is the best solution. This can be done with --force as shown in the following example:

inigo publish apollo-gateway-fed-2-demo:dev 4 --force

The expected output in this example is:

Schema v4 published successfully!