astprinter

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 5 Imported by: ? 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.

Documentation

Overview

Package astprinter takes a GraphQL document and prints it as a String with optional indentation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(document, definition *ast.Document, out io.Writer) error

Print takes a document as well as a definition (optional) and prints it to the io.Writer. The definition is only necessary in case a GraphQL Operation should be printed.

func PrintIndent

func PrintIndent(document, definition *ast.Document, indent []byte, out io.Writer) error

PrintIndent is the same as Print but accepts an additional indent parameter to set indentation.

func PrintString

func PrintString(document, definition *ast.Document) (string, error)

PrintString is the same as Print but returns a string instead of writing to an io.Writer

func PrintStringIndent

func PrintStringIndent(document, definition *ast.Document, indent string) (string, error)

PrintStringIndent is the same as PrintIndent but returns a string instead of writing to an io.Writer

Types

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer walks a GraphQL document and prints it as a string

func (*Printer) Print

func (p *Printer) Print(document, definition *ast.Document, out io.Writer) error

Print starts the actual AST printing Keep a printer and re-use it in case you'd like to print ASTs in the hot path.

Jump to

Keyboard shortcuts

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