Class: GraphQL::InternalRepresentation::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/internal_representation/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDocument

Returns a new instance of Document.



11
12
13
14
# File 'lib/graphql/internal_representation/document.rb', line 11

def initialize
  @operation_definitions = {}
  @fragment_definitions = {}
end

Instance Attribute Details

#fragment_definitionsHash<String, Node> (readonly)

Returns Fragment definition Nodes of this query.

Returns:

  • (Hash<String, Node>)

    Fragment definition Nodes of this query



9
10
11
# File 'lib/graphql/internal_representation/document.rb', line 9

def fragment_definitions
  @fragment_definitions
end

#operation_definitionsHash<String, Node> (readonly)

Returns Operation Nodes of this query.

Returns:

  • (Hash<String, Node>)

    Operation Nodes of this query



6
7
8
# File 'lib/graphql/internal_representation/document.rb', line 6

def operation_definitions
  @operation_definitions
end

Instance Method Details

#[](key) ⇒ Object



16
17
18
19
# File 'lib/graphql/internal_representation/document.rb', line 16

def [](key)
  GraphQL::Deprecation.warn "#{self.class}#[] is deprecated; use `operation_definitions[]` instead"
  operation_definitions[key]
end

#each(&block) ⇒ Object



21
22
23
24
# File 'lib/graphql/internal_representation/document.rb', line 21

def each(&block)
  GraphQL::Deprecation.warn "#{self.class}#each is deprecated; use `operation_definitions.each` instead"
  operation_definitions.each(&block)
end