Oli
Oli

Reputation: 612

Documentation at the top level of a GraphQL schema

I'm documenting all my types, fields and parameters in my schema (SDL), including Query and Mutation at the top - but I can't work out how to add a single piece of documentation for the top-level of the whole schema.

I'm not sure if it's the spec or the tooling - Apollo for example allows me to write schema { }, but not to put anything inside it, or documentation before it.

And there are no examples of it in the docs, particularly at https://graphql.github.io/graphql-spec/June2018/#sec-Descriptions, which shows a "well-described" schema without a top-top-level doc string.

Is this something the spec doesn't cover, or just the tooling?

Upvotes: 1

Views: 734

Answers (1)

Daniel Rearden
Daniel Rearden

Reputation: 84837

Unlike types, the SchemaDefinition spec does not contain a Description. The __Schema introspection type also does not have a description field. So there is no way to set or get a description for the entire schema.

It is, however, an upcoming feature.

Upvotes: 1

Related Questions