Class: GraphQL::Language::Nodes::InterfaceTypeDefinition
Constant Summary
Constants inherited
from AbstractNode
AbstractNode::NO_CHILDREN
Instance Attribute Summary collapse
Attributes inherited from AbstractNode
#filename
Class Method Summary
collapse
Instance Method Summary
collapse
-
#children ⇒ Object
-
#initialize(name: nil, description: nil, comment: nil, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil) ⇒ InterfaceTypeDefinition
constructor
: (?name: untyped, ?description: untyped, ?comment: untyped, ?interfaces: Array, ?directives: Array, ?fields: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) -> void.
-
#marshal_dump ⇒ Object
-
#marshal_load(values) ⇒ Object
-
#merge_directive(**node_opts) ⇒ Object
-
#merge_field(**node_opts) ⇒ Object
-
#merge_interface(**node_opts) ⇒ Object
-
#scalars ⇒ Object
-
#visit_method ⇒ Object
#==, #children_method_name, children_of_type, #col, #definition_line, #delete_child, inherited, #initialize_copy, #line, #merge, #position, #replace_child, #to_query_string
Constructor Details
#initialize(name: nil, description: nil, comment: nil, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil) ⇒ InterfaceTypeDefinition
: (?name: untyped, ?description: untyped, ?comment: untyped, ?interfaces: Array, ?directives: Array, ?fields: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) -> void
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
|
# File 'lib/graphql/language/nodes.rb', line 1842
def initialize(name: nil, description: nil, comment: nil, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil)
@line = line
@col = col
@pos = pos
@filename = filename
@source = source
@name = name
@description = description && -description
@comment =
@interfaces = interfaces.freeze
@directives = directives.freeze
@fields = fields.freeze
@definition_pos = definition_pos
end
|
Instance Attribute Details
1799
1800
1801
|
# File 'lib/graphql/language/nodes.rb', line 1799
def
@comment
end
|
#description ⇒ Object
1797
1798
1799
|
# File 'lib/graphql/language/nodes.rb', line 1797
def description
@description
end
|
#directives ⇒ Object
1810
1811
1812
|
# File 'lib/graphql/language/nodes.rb', line 1810
def directives
@directives
end
|
#fields ⇒ Object
1812
1813
1814
|
# File 'lib/graphql/language/nodes.rb', line 1812
def fields
@fields
end
|
#interfaces ⇒ Object
1808
1809
1810
|
# File 'lib/graphql/language/nodes.rb', line 1808
def interfaces
@interfaces
end
|
#name ⇒ Object
1801
1802
1803
|
# File 'lib/graphql/language/nodes.rb', line 1801
def name
@name
end
|
Class Method Details
.from_a(filename, line, col, name, description, interfaces, directives, fields, comment: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
1857
1858
1859
|
# File 'lib/graphql/language/nodes.rb', line 1857
def self.from_a(filename, line, col, name, description, interfaces, directives, fields, comment: nil) self.new(filename: filename, line: line, col: col, name: name, description: description, comment: , interfaces: interfaces, directives: directives, fields: fields)
end
|
Instance Method Details
#children ⇒ Object
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
|
# File 'lib/graphql/language/nodes.rb', line 1826
def children
@children ||= begin
if !@interfaces.empty? || !@directives.empty? || !@fields.empty?
new_children = []
new_children.concat(@interfaces)
new_children.concat(@directives)
new_children.concat(@fields)
new_children.freeze
new_children
else
NO_CHILDREN
end
end
end
|
#marshal_dump ⇒ Object
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
|
# File 'lib/graphql/language/nodes.rb', line 1861
def marshal_dump
[
line, col, @filename,
@name,
@description,
@interfaces,
@directives,
@fields,
]
end
|
#marshal_load(values) ⇒ Object
1873
1874
1875
|
# File 'lib/graphql/language/nodes.rb', line 1873
def marshal_load(values)
@line, @col, @filename, @name, @description, @interfaces, @directives, @fields = values
end
|
#merge_directive(**node_opts) ⇒ Object
1818
1819
1820
|
# File 'lib/graphql/language/nodes.rb', line 1818
def merge_directive(**node_opts)
merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)])
end
|
#merge_field(**node_opts) ⇒ Object
#merge_interface(**node_opts) ⇒ Object
1814
1815
1816
|
# File 'lib/graphql/language/nodes.rb', line 1814
def merge_interface(**node_opts)
merge(interfaces: interfaces + [GraphQL::Language::Nodes::TypeName.new(**node_opts)])
end
|
#scalars ⇒ Object
1803
1804
1805
|
# File 'lib/graphql/language/nodes.rb', line 1803
def scalars
@scalars ||= [@name].freeze
end
|
#visit_method ⇒ Object
1792
1793
1794
|
# File 'lib/graphql/language/nodes.rb', line 1792
def visit_method
:on_interface_type_definition
end
|