Documentation
¶
Overview ¶
Package load ports load.ts: schema and document loading from file pointers and globs, backed by gqlparser. URL and introspection-JSON loaders are deferred per plan decision D9.
Index ¶
- func ExpandPointers(pointers []any, cwd string) ([]string, error)
- func LoadDocuments(files []string) ([]*plugin.DocumentFile, error)
- func LoadSchema(files []string) (*ast.Schema, error)
- func NormalizeDocumentPointers(docs any, cwd string) ([]*plugin.DocumentFile, error)
- func WalkDocuments(schema *ast.Schema, docs []*plugin.DocumentFile) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPointers ¶
ExpandPointers normalises a pointer (string | map[string]any | []any) into a flat list of concrete file paths by expanding globs. Map keys are treated as pointers, values (options) are ignored for now.
func LoadDocuments ¶
func LoadDocuments(files []string) ([]*plugin.DocumentFile, error)
LoadDocuments reads + parses GraphQL operation documents from files, returning one DocumentFile per file. .graphql/.gql files are parsed directly; code files (.ts/.tsx/.js) have gql-tagged templates plucked (basic support).
func LoadSchema ¶
LoadSchema reads + merges all schema files into a resolved *ast.Schema (the graphql-js buildASTSchema equivalent). It prepends validator.Prelude. Mirroring @graphql-tools/load's default sort:true, it sorts type fields and enum values alphabetically after loading.
func NormalizeDocumentPointers ¶
func NormalizeDocumentPointers(docs any, cwd string) ([]*plugin.DocumentFile, error)
NormalizeDocumentPointers converts the config's documents field into a []*DocumentFile.
func WalkDocuments ¶
func WalkDocuments(schema *ast.Schema, docs []*plugin.DocumentFile) error
WalkDocuments populates the type back-references on document nodes (field.Definition, field.ObjectDefinition, inlineFragment.ObjectDefinition, fragmentSpread.Definition) so plugins can resolve selection-set field types. It mirrors graphql-js's visitWithTypeInfo.
Types ¶
This section is empty.