-
Notifications
You must be signed in to change notification settings - Fork 7
Sharing schema
Tom Andrews edited this page Sep 5, 2018
·
2 revisions
Currently we share the graphql schema between the UI and API. This is because the UI needs to know the schema for linting and at runtime apollo client needs to know the fragment types so it can map the data correctly.
We share the schema in a separate repository and then publish this to npm and include it both API and UI. The changes to the API and Schema need to be coordinated and the npm credentials to publish need to be shared between the team.
- Move the schema into the API so they are held together.
- Use a build/dev time task to perform an introspection query to extract the schema from the API the environment is pointing at for linting.
- At runtime perform a query to extract the fragment types from the API the UI is running against.
- Currently we lint as a part of the build process (as well as the separate lint task) this means that it needs to know the full schema for the linting. We build the app in a number of places (travis, netlify and concourse) so we need to stop the building from performing linting and just run that in travis (and dev) so there is no extra dependency on a running API.
- This creates a dependency on basic dev commands in author and having a running API.