Every project has a schema that defines the GraphQL APIs functionality.
At a high level, your project's schema is the blueprint used to generate the features you want your project to have.
At a low level, the schema is a JSON file in which you can configure your project's GraphQL API.
When you edit your project in the admin UI, properties are added to your schema for you. Editing the schema JSON allows you to manually configure your API.
Configurable properties include:
- Services are the APIs your project will use. Learn more about configuring Services.
- Shapes define the data structures your API manipulates. Learn more about configuring Shapes.
- Queries and Mutations define the GraphQL operations your API uses to fetch and modify data from ShapeDB and connected services. Learn more about configuring Queries and Mutations.
- API Indexing caches data from remote services for faster query response times. Learn more about configuring API Indexing.
- Forms define the admin UI interface you'll use in the Data tab when manually creating instances of shapes. Learn more about configuring forms.
- Workflows structure the process of developing content for publication. Learn more about configuring workflows.
- Locales define which language tags your project supports for internationalization. Learn more about configuring localization.
Configuring a project schema
Editing the schema is required for most non-trivial projects. We have many docs to walk you through that process listed above, but if you want to see all the options available to you, you should check out our schema specification.
Configuring query resolvers
Resolvers are JSON objects in a schema that define how a project's queries and mutations behave. Is the query being made to a REST API rather than GraphQL? Is its data coming from a remote service rather than the project's local ShapeDB? Does the query fetch data from multiple endpoints in multiple APIs? Resolvers define all this behavior.
Check out our Resolvers section for properties, descriptions, and examples.
We recommend editing project schemas in the admin UI. Our JSON editor provides inline validation and smart autocomplete suggestions. You can also immediately see and test the ways that schema changes impact your GraphQL API.
If you would rather use an external interface, you can export your schema by selecting the Export Schema button above the JSON editor in the web client.
You can also use our CLI, or your project's REST endpoint. Learn more in our guide on importing and exporting your schema.
Ready to start? First, learn about the most fundamental schema concept: Shapes. Read our Shapes guide now.
Still need help? Get in touch with us.