class GraphQL::Language::Nodes::Document
This is the AST root for normal queries
@example Deriving a document by parsing a string
document = GraphQL.parse(query_string)
@example Creating a string from a document
document.to_query_string # { ... }
@example Creating a custom string from a document
class VariableScrubber < GraphQL::Language::Printer def print_argument(arg) "#{arg.name}: <HIDDEN>" end end document.to_query_string(printer: VariableSrubber.new)
Attributes
children[RW]
definitions[RW]
Public Instance Methods
initialize_node(definitions: [])
click to toggle source
@!attribute definitions
@return [Array<OperationDefinition, FragmentDefinition>] top-level GraphQL units: operations or fragments
# File lib/graphql/language/nodes.rb, line 173 def initialize_node(definitions: []) @definitions = definitions end
slice_definition(name)
click to toggle source
# File lib/graphql/language/nodes.rb, line 177 def slice_definition(name) GraphQL::Language::DefinitionSlice.slice(self, name) end