formatter

package
v2.5.30 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: MIT Imports: 5 Imported by: 145

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	FormatSchema(schema *ast.Schema)
	FormatSchemaDocument(doc *ast.SchemaDocument)
	FormatQueryDocument(doc *ast.QueryDocument)
}

func NewFormatter

func NewFormatter(w io.Writer, options ...FormatterOption) Formatter

type FormatterOption added in v2.4.2

type FormatterOption func(*formatter)

func WithBuiltin added in v2.5.12

func WithBuiltin() FormatterOption

WithBuiltin includes builtin fields/directives/etc from the source/AST in the formatted output.

func WithComments added in v2.5.8

func WithComments() FormatterOption

WithComments includes comments from the source/AST in the formatted output.

func WithCompacted added in v2.5.24

func WithCompacted() FormatterOption

WithCompacted enables compacted output, which removes all unnecessary whitespace.

func WithIndent added in v2.4.2

func WithIndent(indent string) FormatterOption

WithIndent uses the given string for indenting block bodies in the output, instead of the default, `"\t"`.

func WithoutDescription added in v2.5.18

func WithoutDescription() FormatterOption

WithoutDescription excludes GQL description from the source/AST in the formatted output.

Jump to

Keyboard shortcuts

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