Keeping schemas up-to-date in client apps
Recommendations and best practices for keeping client apps updated
Client apps need to keep their schemas up-to-date whenever changes are made to the supergraph. In order to facilitate this Apollo recommends setting up the following:
- Schema change notifications and ensure messages are sent to the appropriate channels
- Configure Apollo Swift and Apollo Kotlin build tasks to fetch the latest API schema
rover graph fetch
to fetch the API schema for any other applications.- Configure code generation tools for Swift, Kotlin and other platforms
To ensure that your client operations are valid against the most recent schema, we recommend re-running code generation in your continuous integration system before merging client changes. The specific steps required are as follows:
- Fetch the latest production schema using any of the methods described above, prior to merging any changes to your client code
- Run codegen against this schema
- The codegen task will validate that any operations used by the client application are compatible with this schema.