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.crClass Method Summary
- .generate(node : Field, indent : String = "")
- .generate(node : InputObject, indent : String = "")
- .generate(node : Float | Int | String | Nil | Bool, indent : String = "")
- .generate(node : Symbol, indent : String = "")
- .generate(node : Array, indent : String = "")
- .generate(node : Hash, indent : String = "")
- .generate(node : Document, indent : String = "")
- .generate(node : Argument, indent : String = "")
- .generate(node : Directive, indent : String = "")
- .generate(node : AEnum, indent : String = "")
- .generate(node : NullValue, indent : String = "")
- .generate(node : FragmentDefinition, indent : String = "")
- .generate(node : FragmentSpread, indent : String = "")
- .generate(node : InlineFragment, indent : String = "")
- .generate(node : ListType, indent : String = "")
- .generate(node : NonNullType, indent : String = "")
- .generate(node : OperationDefinition, indent : String = "")
- .generate(node : TypeName, indent : String = "")
- .generate(node : VariableDefinition)
- .generate(node : VariableIdentifier, indent : String = "")
- .generate(node : SchemaDefinition, indent : String = "")
- .generate(node : ScalarTypeDefinition, indent : String = "")
- .generate(node : ObjectTypeDefinition, indent : String = "")
- .generate(node : InputValueDefinition, indent : String = "")
- .generate(node : FieldDefinition, indent : String = "")
- .generate(node : InterfaceTypeDefinition, indent : String = "")
- .generate(node : UnionTypeDefinition, indent : String = "")
- .generate(node : EnumTypeDefinition, indent : String = "")
- .generate(node : EnumValueDefinition, indent : String = "")
- .generate(node : InputObjectTypeDefinition, indent : String = "")
- .generate(node : DirectiveDefinition, indent : String = "")
- .generate(node, indent : String = "")
- .generate_description(node, indent = "", first_in_block = true)
- .generate_directives(directives, indent : String = "")
- .generate_field_definitions(fields, indent : String = "")
- .generate_selections(selections, indent : String = "")