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 notificationsand ensure messages are sent to the appropriate channels
- Configure Apollo SwiftandApollo Kotlinbuild tasks to fetch the latest API schema
- to fetch the API schema for any other applications.
rover graph fetch
- Configure code generation tools for Swift,Kotlinandother 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.