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

gqlutil

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package gqlutil holds thin helpers over gqlparser's AST, mirroring the graphql-js type helpers that the TS plugins lean on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseType

func BaseType(schema *ast.Schema, t *ast.Type) *ast.Definition

BaseType returns the named type definition for a type reference, or nil.

func IsAbstract

func IsAbstract(d *ast.Definition) bool

IsAbstract reports whether a definition is an interface or union.

func IsLeaf

func IsLeaf(d *ast.Definition) bool

IsLeaf reports whether a definition is a scalar or enum.

func IsList

func IsList(t *ast.Type) bool

IsList reports whether the type (after any non-null wrapper) is a list.

func IsNonNull

func IsNonNull(t *ast.Type) bool

IsNonNull reports whether the outermost type wrapper is NonNull.

func NamedType

func NamedType(t *ast.Type) (name string, nonNull bool)

NamedType unwraps List and NonNull wrappers to reach the named type, and reports whether the outer type was non-null at the top level.

func TypeString

func TypeString(t *ast.Type) string

TypeString renders a type reference back to its SDL form ("String", "[String!]!", "ID", etc.) — graphql-js's String(type).

func UnwrapNonNull

func UnwrapNonNull(t *ast.Type) *ast.Type

UnwrapNonNull removes the outermost NonNull wrapper (graphql-js ofType).

Types

This section is empty.

Jump to

Keyboard shortcuts

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