module GraphQL::Language::Generation

Overview

Exposes {.generate}, which turns AST nodes back into query strings. Turn an AST node back into a string.

@example Turning a document into a query document = GraphQL.parse(query_string) Generation.generate(document) # => "{ ... }"

@param node [AbstractNode] an AST node to recursively stringify @param indent [String] Whitespace to add to each printed node @return [String] Valid GraphQL for node

Defined in:

graphql-crystal/language/generation.cr

Class Method Summary

Class Method Detail

def self.generate(node : Directive, indent : String = "") #

[View source]
def self.generate(node, indent : String = "") #

[View source]
def self.generate(node : DirectiveDefinition, indent : String = "") #

[View source]
def self.generate(node : InputObjectTypeDefinition, indent : String = "") #

[View source]
def self.generate(node : EnumValueDefinition, indent : String = "") #

[View source]
def self.generate(node : EnumTypeDefinition, indent : String = "") #

[View source]
def self.generate(node : UnionTypeDefinition, indent : String = "") #

[View source]
def self.generate(node : InterfaceTypeDefinition, indent : String = "") #

[View source]
def self.generate(node : FieldDefinition, indent : String = "") #

[View source]
def self.generate(node : InputValueDefinition, indent : String = "") #

[View source]
def self.generate(node : ObjectTypeDefinition, indent : String = "") #

[View source]
def self.generate(node : ScalarTypeDefinition, indent : String = "") #

[View source]
def self.generate(node : SchemaDefinition, indent : String = "") #

[View source]
def self.generate(node : VariableIdentifier, indent : String = "") #

[View source]
def self.generate(node : VariableDefinition) #

[View source]
def self.generate(node : TypeName, indent : String = "") #

[View source]
def self.generate(node : OperationDefinition, indent : String = "") #

[View source]
def self.generate(node : Float | Int | String | Nil | Bool, indent : String = "") #

[View source]
def self.generate(node : Symbol, indent : String = "") #

[View source]
def self.generate(node : Array, indent : String = "") #

[View source]
def self.generate(node : Hash, indent : String = "") #

[View source]
def self.generate(node : Document, indent : String = "") #

[View source]
def self.generate(node : Argument, indent : String = "") #

[View source]
def self.generate(node : AEnum, indent : String = "") #

[View source]
def self.generate(node : NullValue, indent : String = "") #

[View source]
def self.generate(node : Field, indent : String = "") #

[View source]
def self.generate(node : FragmentDefinition, indent : String = "") #

[View source]
def self.generate(node : FragmentSpread, indent : String = "") #

[View source]
def self.generate(node : InlineFragment, indent : String = "") #

[View source]
def self.generate(node : InputObject, indent : String = "") #

[View source]
def self.generate(node : ListType, indent : String = "") #

[View source]
def self.generate(node : NonNullType, indent : String = "") #

[View source]
def self.generate_description(node, indent = "", first_in_block = true) #

[View source]
def self.generate_directives(directives, indent : String = "") #

[View source]
def self.generate_field_definitions(fields, indent : String = "") #

[View source]
def self.generate_selections(selections, indent : String = "") #

[View source]