Documentation
¶
Overview ¶
Package graphql loads GraphQL SDL schemas and maps them into Synapse graph IR.
Index ¶
- func FieldID(specPath, typeName, field string) graph.NodeID
- func FieldSymbol(typeName, field string) string
- func GQLKindProp(kind ast.DefinitionKind) string
- func ListSpecFiles(root string, ignoreDirNames []string) ([]string, error)
- func Load(path string) (*ast.SchemaDocument, error)
- func LoadBytes(data []byte, name string) (*ast.SchemaDocument, error)
- func LooksLikeGraphQL(data []byte) bool
- func OperationID(specPath, root, field string) graph.NodeID
- func OperationSymbol(root, field string) string
- func ParseFile(absPath, relPath string) (parse.Result, error)
- func ToResult(specPath string, doc *ast.SchemaDocument) parse.Result
- func TypeID(specPath, name string) graph.NodeID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldSymbol ¶
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 ¶
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 ¶
LooksLikeGraphQL reports whether data appears to be a GraphQL SDL document.
func OperationID ¶
OperationID builds a Phase-1 node id for a root GraphQL field.
func OperationSymbol ¶
OperationSymbol is the URI/legacy symbol for a root GraphQL field (e.g. "query users", "mutation createUser").
func ParseFile ¶
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.
Types ¶
This section is empty.