Help us shape the future of Go! Take the 2026 Go Developer Survey

graphql

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package graphql loads GraphQL SDL schemas and maps them into Synapse graph IR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldID

func FieldID(specPath, typeName, field string) graph.NodeID

FieldID builds a Phase-1 node id for a GraphQL field (Type.field).

func FieldSymbol

func FieldSymbol(typeName, field string) string

FieldSymbol is the display/URI symbol for a field node.

func GQLKindProp

func GQLKindProp(kind ast.DefinitionKind) string

GQLKindProp maps an AST definition kind to the graph props gql_kind value.

func ListSpecFiles

func ListSpecFiles(root string, ignoreDirNames []string) ([]string, error)

ListSpecFiles walks root and returns absolute paths of GraphQL SDL schema docs. Directories named in ignoreDirNames are skipped (defaults match parse.DefaultIgnoreDirNames).

func Load

func Load(path string) (*ast.SchemaDocument, error)

Load reads and parses a GraphQL SDL document from path (syntax only; no schema validation).

func LoadBytes

func LoadBytes(data []byte, name string) (*ast.SchemaDocument, error)

LoadBytes parses GraphQL SDL from data into a SchemaDocument without cross-file validation, so split schemas can be indexed file-by-file. name is used as the source name in errors.

func LooksLikeGraphQL

func LooksLikeGraphQL(data []byte) bool

LooksLikeGraphQL reports whether data appears to be a GraphQL SDL document.

func OperationID

func OperationID(specPath, root, field string) graph.NodeID

OperationID builds a Phase-1 node id for a root GraphQL field.

func OperationSymbol

func OperationSymbol(root, field string) string

OperationSymbol is the URI/legacy symbol for a root GraphQL field (e.g. "query users", "mutation createUser").

func ParseFile

func ParseFile(absPath, relPath string) (parse.Result, error)

ParseFile loads path and returns graph IR. Relative path is used as Node.Path when relPath is non-empty; otherwise filepath.Base of path is used.

func ToResult

func ToResult(specPath string, doc *ast.SchemaDocument) parse.Result

ToResult maps a GraphQL SchemaDocument into Synapse parse IR for the given repo-relative spec path (slash-separated). Uses syntactic parse output only (no validated Schema), so partial/split files still emit nodes.

func TypeID

func TypeID(specPath, name string) graph.NodeID

TypeID builds a Phase-1 node id for a GraphQL named type.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL