gqlparser

package module
v2.0.0-...-349414a Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gqlparser CircleCI Go Report Card Coverage Status

This is a parser for graphql, written to mirror the graphql-js reference implementation as closely while remaining idiomatic and easy to use.

spec target: September 2025 and select portions of the Draft, based on the graphql-js reference implementation graphql-js v16.13.2. This includes Schema definition language, block strings as descriptions, error paths & extension, etc. If there is a spec update or new release, please follow this process to update and submit a PR.

This parser is used by gqlgen, and it should be reasonably stable.

Guiding principles:

  • maintainability: It should be easy to stay up to date with the spec
  • well tested: It shouldn't need a graphql server to validate itself. Changes to this repo should be self contained.
  • server agnostic: It should be usable by any of the graphql server implementations, and any graphql client tooling.
  • idiomatic & stable api: It should follow go best practices, especially around forwards compatibility.
  • fast: Where it doesn't impact on the above it should be fast. Avoid unnecessary allocs in hot paths.
  • close to reference: Where it doesn't impact on the above, it should stay close to the graphql/graphql-js reference implementation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadQuery deprecated

func LoadQuery(schema *ast.Schema, str string) (*ast.QueryDocument, gqlerror.List)

Deprecated: use LoadQueryWithRules instead.

func LoadQueryWithRules

func LoadQueryWithRules(
	schema *ast.Schema,
	str string,
	rules *rules.Rules,
) (*ast.QueryDocument, gqlerror.List)

func LoadSchema

func LoadSchema(str ...*ast.Source) (*ast.Schema, error)

func MustLoadQuery deprecated

func MustLoadQuery(schema *ast.Schema, str string) *ast.QueryDocument

Deprecated: use MustLoadQueryWithRules instead.

func MustLoadQueryWithRules

func MustLoadQueryWithRules(schema *ast.Schema, str string, rules *rules.Rules) *ast.QueryDocument

func MustLoadSchema

func MustLoadSchema(str ...*ast.Source) *ast.Schema

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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