Skip to main content

Module load

Module load 

Source
Expand description

Schema ingestion: a source string is either an http(s) URL (introspect) or a path to an SDL file. Both produce the same SchemaRecord list, so nothing downstream cares which it was. When no source is given, discover finds a schema in the current directory tree.

Modules§

introspect
Load a schema by introspection — from a live endpoint (POST the standard introspection query) or a local introspection JSON dump. Both flatten the __schema payload into the same SchemaRecords that SDL produces.
sdl
Parse GraphQL SDL and flatten every definition into SchemaRecords.

Structs§

LoadOptions
Options that shape loading. Only URL introspection consults them; file and SDL sources ignore them.

Functions§

discover
Find a schema when none was passed: walk the current directory tree for schema documents (not operation docs), preferring .graphqls, then a schema.* file, then any .graphql/.gql whose contents look like SDL. Nearest (shallowest) wins; other candidates elsewhere are reported.
load
Load a schema from a file path or an http(s) URL and flatten it to records.