Class: GraphQL::StaticValidation::Validator::Context
- Inherits:
-
Object
- Object
- GraphQL::StaticValidation::Validator::Context
- Defined in:
- lib/graph_ql/static_validation/validator.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#fragments ⇒ Object
readonly
Returns the value of attribute fragments.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#visitor ⇒ Object
readonly
Returns the value of attribute visitor.
Instance Method Summary collapse
- #field_definition ⇒ Object
-
#initialize(schema, document) ⇒ Context
constructor
A new instance of Context.
- #object_types ⇒ Object
Constructor Details
#initialize(schema, document) ⇒ Context
Returns a new instance of Context.
30 31 32 33 34 35 36 37 38 |
# File 'lib/graph_ql/static_validation/validator.rb', line 30 def initialize(schema, document) @schema = schema @document = document @fragments = {} @errors = [] @visitor = GraphQL::Visitor.new @visitor[GraphQL::Nodes::FragmentDefinition] << -> (node, parent) { @fragments[node.name] = node } @type_stack = GraphQL::StaticValidation::TypeStack.new(schema, visitor) end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
29 30 31 |
# File 'lib/graph_ql/static_validation/validator.rb', line 29 def document @document end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
29 30 31 |
# File 'lib/graph_ql/static_validation/validator.rb', line 29 def errors @errors end |
#fragments ⇒ Object (readonly)
Returns the value of attribute fragments.
29 30 31 |
# File 'lib/graph_ql/static_validation/validator.rb', line 29 def fragments @fragments end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
29 30 31 |
# File 'lib/graph_ql/static_validation/validator.rb', line 29 def schema @schema end |
#visitor ⇒ Object (readonly)
Returns the value of attribute visitor.
29 30 31 |
# File 'lib/graph_ql/static_validation/validator.rb', line 29 def visitor @visitor end |
Instance Method Details
#field_definition ⇒ Object
44 45 46 |
# File 'lib/graph_ql/static_validation/validator.rb', line 44 def field_definition @type_stack.field_definitions.last end |
#object_types ⇒ Object
40 41 42 |
# File 'lib/graph_ql/static_validation/validator.rb', line 40 def object_types @type_stack.object_types end |