parser

package
v0.10.25 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Interfaces map[string]graphql.ResolveTypeFn
	Resolvers  map[string]graphql.FieldResolveFn
	Scalars    map[string]ScalarFunctions
	Unions     map[string]graphql.ResolveTypeFn
}

Config definies implementation of functions to be called that parser will bind with types/fields of schema.

type Parser

type Parser struct {
	Config
	// contains filtered or unexported fields
}

Parser binds defined functions with fields/types defined in schema source

func NewParser

func NewParser(c Config) Parser

NewParser creates a schema Parser with a config

func (*Parser) Parse

func (p *Parser) Parse(source string) (graphql.Schema, error)

Parse schema source using parser

type ScalarFunctions

type ScalarFunctions struct {
	// Parse scalar function definition
	Parse graphql.ParseValueFn
	// Serialize scalar function definition
	Serialize graphql.SerializeFn
}

ScalarFunctions definitions

type TypeResolver

type TypeResolver interface {
	ResolveType(p graphql.ResolveTypeParams, types []*graphql.Object) *graphql.Object
}

Jump to

Keyboard shortcuts

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