Class: GraphQL::InternalRepresentation::Document
- Inherits:
-
Object
- Object
- GraphQL::InternalRepresentation::Document
- Defined in:
- lib/graphql/internal_representation/document.rb
Instance Attribute Summary collapse
-
#fragment_definitions ⇒ Hash<String, Node>
readonly
Fragment definition Nodes of this query.
-
#operation_definitions ⇒ Hash<String, Node>
readonly
Operation Nodes of this query.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize ⇒ Document
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_definitions ⇒ Hash<String, Node> (readonly)
Returns 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_definitions ⇒ Hash<String, Node> (readonly)
Returns 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) 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) warn "#{self.class}#each is deprecated; use `operation_definitions.each` instead" operation_definitions.each(&block) end |