Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions api-playground/graphql-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Add a GraphQL schema

To create pages for your GraphQL API, you need a valid GraphQL schema in SDL (Schema Definition Language) format. Store the schema in your documentation repository or host it at an HTTPS URL that Mintlify can fetch.

Check warning on line 9 in api-playground/graphql-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/graphql-setup.mdx#L9

Spell out 'SDL', if it's unfamiliar to the audience.

```graphql schema.graphql
"An object with a stable identifier."
Expand Down Expand Up @@ -79,7 +79,7 @@
</Note>

<ParamField path="source" type="string" required>
A local path to an SDL file in your documentation repository or an HTTPS URL to a hosted SDL file. Does not accept HTTP URLs.

Check warning on line 82 in api-playground/graphql-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/graphql-setup.mdx#L82

Spell out 'SDL', if it's unfamiliar to the audience.

Check warning on line 82 in api-playground/graphql-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/graphql-setup.mdx#L82

Spell out 'SDL', if it's unfamiliar to the audience.
</ParamField>

<ParamField path="directory" type="string">
Expand All @@ -92,10 +92,12 @@

- **Queries**: One page per field on your `Query` root type.
- **Mutations**: One page per field on your `Mutation` root type.
- **Types**: One page per named object, input, enum, interface, or union type.
- **Types**: One page per named object, input, enum, interface, union, or custom scalar type.

On a tab, the sections appear after any groups you define. On a group, they appear as nested groups after any pages you list.

Page URLs use each name as written, such as `graphql-reference/types/Cart`. If two names differ only by case, such as `StoreFrontConfigType` and `StorefrontConfigType`, the name that sorts first keeps that URL and the other uses a kebab-case URL, such as `graphql-reference/types/storefront-config-type`. The build logs a warning for each name that gets a new URL.

Each operation page shows the field description, arguments, return type, and links to any referenced types. Query and mutation pages also include a generated example operation, the required variables, and a sample JSON response.

Type pages render the schema definition read-only, with linked field types so readers can navigate the graph.
Expand Down Expand Up @@ -133,7 +135,7 @@

- `QUERY <field>`: A field on your `Query` root type.
- `MUTATION <field>`: A field on your `Mutation` root type.
- `TYPE <name>`: A named object, input, enum, interface, or union type.
- `TYPE <name>`: A named object, input, enum, interface, union, or custom scalar type.

Selector kinds must be uppercase. Use a dotted path, such as `MUTATION cart.createCart`, to select an operation nested under a namespace field. `TYPE` selectors do not accept dotted paths.

Expand All @@ -141,7 +143,7 @@

If any page under a tab or group with `graphql` is a selector, Mintlify skips generating the full **Queries**, **Mutations**, and **Types** sections for it. Regular page paths in the same `pages` array work as usual.

In a curated reference, query and mutation pages link only to the type pages that your selectors generate. To link a type referenced by a selected operation, add a `TYPE` selector for that type.

Check warning on line 146 in api-playground/graphql-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/graphql-setup.mdx#L146

Use the Oxford comma in 'In a curated reference, query and'.

If a selector does not match anything in your schema, the build fails with an error that names the missing operation or type.

Expand All @@ -151,4 +153,4 @@

## Update your documentation

Mintlify regenerates GraphQL reference pages when you run `mint dev` or when you push changes to your documentation repository. If your schema is hosted at an HTTPS URL, updates to the schema regenerate on the next build.

Check warning on line 156 in api-playground/graphql-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/graphql-setup.mdx#L156

In general, use active voice instead of passive voice ('is hosted').
Loading