Module: GraphQL::Schema::Member::HasAstNode Private

Included in:
GraphQL::Schema, Argument, EnumValue, Field, Interface::DefinitionMethods, GraphQL::Schema::Member
Defined in:
lib/graphql/schema/member/has_ast_node.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ast_node(new_ast_node = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

If this schema was parsed from a .graphql file (or other SDL), this is the AST node that defined this part of the schema.



18
19
20
21
22
23
24
25
26
# File 'lib/graphql/schema/member/has_ast_node.rb', line 18

def ast_node(new_ast_node = nil)
  if new_ast_node
    @ast_node = new_ast_node
  elsif defined?(@ast_node)
    @ast_node
  else
    nil
  end
end

Instance Method Details

#inherited(child_cls) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
14
# File 'lib/graphql/schema/member/has_ast_node.rb', line 11

def inherited(child_cls)
  super
  child_cls.ast_node = nil
end