graphql

package
v0.0.0-...-83efb8c Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphQLBoolean = &ast.Definition{
	Kind:        ast.Scalar,
	Description: "The `Boolean` scalar type represents `true` or `false`.",
	Name:        "Boolean",
	Position:    blankBuiltInPos,
	BuiltIn:     true,
}
View Source
var GraphQLDeprecatedDirective = &ast.DirectiveDefinition{
	Description: "Marks an element of a GraphQL schema as no longer supported.",
	Name:        "deprecated",
	Arguments: ast.ArgumentDefinitionList{
		&ast.ArgumentDefinition{
			Description: "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",
			Name:        "reason",
			DefaultValue: &ast.Value{
				Raw:      "No longer supported",
				Kind:     ast.StringValue,
				Position: blankBuiltInPos,
			},
			Type: &ast.Type{
				NamedType: "String",
				Position:  blankBuiltInPos,
			},
			Position: blankBuiltInPos,
		},
	},
	Locations: []ast.DirectiveLocation{
		ast.LocationFieldDefinition,
		ast.LocationArgumentDefinition,
		ast.LocationInputFieldDefinition,
		ast.LocationEnumValue,
	},
	Position: blankBuiltInPos,
}

Used to declare element of a GraphQL schema as deprecated.

View Source
var GraphQLFloat = &ast.Definition{
	Kind:        ast.Scalar,
	Description: "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",
	Name:        "Float",
	Position:    blankBuiltInPos,
	BuiltIn:     true,
}
View Source
var GraphQLID = &ast.Definition{
	Kind:        ast.Scalar,
	Description: "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.",
	Name:        "ID",
	Position:    blankBuiltInPos,
	BuiltIn:     true,
}
View Source
var GraphQLIncludeDirective = &ast.DirectiveDefinition{
	Description: "Directs the executor to include this field or fragment only when the `if` argument is true.",
	Name:        "include",
	Arguments: ast.ArgumentDefinitionList{
		&ast.ArgumentDefinition{
			Description: "Included when true.",
			Name:        "if",
			Type: &ast.Type{
				NamedType: "Boolean",
				NonNull:   true,
				Position:  blankBuiltInPos,
			},
			Position: blankBuiltInPos,
		},
	},
	Locations: []ast.DirectiveLocation{
		ast.LocationField,
		ast.LocationFragmentSpread,
		ast.LocationInlineFragment,
	},
	Position: blankBuiltInPos,
}

Used to conditionally include fields or fragments.

View Source
var GraphQLInt = &ast.Definition{
	Kind:        ast.Scalar,
	Description: "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
	Name:        "Int",
	Position:    blankBuiltInPos,
	BuiltIn:     true,
}
View Source
var GraphQLSkipDirective = &ast.DirectiveDefinition{
	Description: "Directs the executor to skip this field or fragment when the `if` argument is true.",
	Name:        "skip",
	Arguments: ast.ArgumentDefinitionList{
		&ast.ArgumentDefinition{
			Description: "Skipped when true.",
			Name:        "if",
			Type: &ast.Type{
				NamedType: "Boolean",
				NonNull:   true,
				Position:  blankBuiltInPos,
			},
			Position: blankBuiltInPos,
		},
	},
	Locations: []ast.DirectiveLocation{
		ast.LocationField,
		ast.LocationFragmentSpread,
		ast.LocationInlineFragment,
	},
	Position: blankBuiltInPos,
}

Used to conditionally skip (exclude) fields or fragments.

View Source
var GraphQLSpecifiedByDirective = &ast.DirectiveDefinition{
	Description: "Exposes a URL that specifies the behaviour of this scalar.",
	Name:        "specifiedBy",
	Arguments: ast.ArgumentDefinitionList{
		&ast.ArgumentDefinition{
			Description: "The URL that specifies the behaviour of this scalar.",
			Name:        "url",
			Type: &ast.Type{
				NamedType: "String",
				NonNull:   true,
				Position:  blankBuiltInPos,
			},
			Position: blankBuiltInPos,
		},
	},
	Locations: []ast.DirectiveLocation{
		ast.LocationScalar,
	},
	Position: blankBuiltInPos,
}

Used to provide a URL for specifying the behaviour of custom scalar definitions.

View Source
var GraphQLString = &ast.Definition{
	Kind:        ast.Scalar,
	Description: "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
	Name:        "String",
	Position:    blankBuiltInPos,
	BuiltIn:     true,
}
View Source
var IntrospectionTypes = ast.DefinitionList{
	__Schema,
	__Directive,
	__DirectiveLocation,
	__Type,
	__Field,
	__InputValue,
	__EnumValue,
	__TypeKind,
}
View Source
var SchemaMetaFieldDef = &ast.FieldDefinition{
	Name:        "__schema",
	Description: "Access the current type schema of this server.",
	Type:        ast.NamedType("__Schema", nil),
}

The full list of specified directives.

View Source
var TypeMetaFieldDef = &ast.FieldDefinition{
	Name:        "__type",
	Description: "Request the type information of a single type.",
	Type:        ast.NamedType("__Type", nil),
	Arguments: []*ast.ArgumentDefinition{
		{
			Name:     "name",
			Type:     ast.NonNullNamedType("String", nil),
			Position: blankBuiltInPos,
		},
	},
	Position: blankBuiltInPos,
}
View Source
var TypeNameMetaFieldDef = &ast.FieldDefinition{
	Name:     "__typename",
	Type:     ast.NamedType("String", nil),
	Position: blankBuiltInPos,
}

Functions

func ExtendSchemaAssumeValidDSL

func ExtendSchemaAssumeValidDSL(ctx context.Context, schema *ast.Schema, documentAST *ast.SchemaDocument) (*ast.Schema, *gqlerror.Error)

func IsIntrospectionType

func IsIntrospectionType(typeName string) bool

func IsSpecifiedDirective

func IsSpecifiedDirective(directiveName string) bool

func LexicographicSortSchema

func LexicographicSortSchema(schema *ast.Schema) *ast.Schema

Types

This section is empty.

Jump to

Keyboard shortcuts

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