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 [ASTNode] 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/language/generation.cr

Class Method Summary

Class Method Detail

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

def self.generate(node : VariableDefinition) #

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

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

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

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

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

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

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

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

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

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

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

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

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

def self.generate_description(node, indent = "", first_in_block = true) #

def self.generate_directives(directives, indent : String = "") #

def self.generate_field_definitions(fields, indent : String = "") #

def self.generate_selections(selections, indent : String = "") #