Learn GraphQL by example
GraphQL schemas in SDL: descriptions, syntax errors and their fixes, and a schema checked, mocked and published from Git. Each page comes with the output of the tools that read the example, and says when it was last checked.
- GraphQL "Syntax Error: Expected Name, found ...": causes and fixes in SDL
What the GraphQL parser means by Expected Name, Expected ":" and Unexpected character, with the schema mistake behind each: empty braces or arguments, a missing type, a missing colon or brace, a dash in a name, a semicolon. Every message as apigit lint printed it, with its line and column.
- GraphQL and OpenAPI together: one repository, linted, mocked and published as one site
A REST API in OpenAPI and a GraphQL schema can live in one Git repository, be checked in one lint run, be mocked locally or as one hosted mock with two base paths, and be published as one documentation site with apigit.json navigation. Every step with its command and output, and what does not cover GraphQL.
- GraphQL schema documentation: descriptions, deprecation, and how the reference renders
A GraphQL schema documents itself: a string before a type, field, argument or enum value is its description, and @deprecated marks what clients should stop using. The syntax from the specification, a schema that uses both, what introspection returns, and what the rendered reference shows.
- Schema-first GraphQL: write the schema, lint it, mock it, call it
Schema-first means the SDL schema is written and agreed before any resolver exists. A worked loop with one file: write schema.graphql, lint it, serve it as a mock with apigit mock serve, call it with curl while the schema changes, and catch the mistakes each step finds.
- A GraphQL mock server from a schema file, in one command
apigit mock serve schema.graphql answers every query and mutation of an SDL schema at /graphql with generated values, and refuses queries the schema does not allow. What it returns, what it validates, and what it does not mock.
Try it with your own API
Create a free workspace, add your API files, and publish their documentation and a mock server from the same repository.
Free for individuals. No credit card.
$ npm install -g @apigit/cli$ apigit auth login$ apigit doc publish