...

Package formatter

import "github.com/vektah/gqlparser/v2/formatter"
Overview
Index

Overview ▾

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

type FormatterOption func(*formatter)

func WithComments

func WithComments() FormatterOption

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

func WithIndent

func WithIndent(indent string) FormatterOption

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