Class: GraphQL::Language::Nodes::InterfaceTypeExtension
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, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ InterfaceTypeExtension
constructor
: (?name: untyped, ?interfaces: Array, ?directives: Array, ?fields: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) -> 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, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ InterfaceTypeExtension
: (?name: untyped, ?interfaces: Array, ?directives: Array, ?fields: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) -> void
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
|
# File 'lib/graphql/language/nodes.rb', line 1932
def initialize(name: nil, interfaces: NO_CHILDREN, directives: NO_CHILDREN, fields: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil)
@line = line
@col = col
@pos = pos
@filename = filename
@source = source
@name = name
@interfaces = interfaces.freeze
@directives = directives.freeze
@fields = fields.freeze
end
|
Instance Attribute Details
#directives ⇒ Object
1900
1901
1902
|
# File 'lib/graphql/language/nodes.rb', line 1900
def directives
@directives
end
|
#fields ⇒ Object
1902
1903
1904
|
# File 'lib/graphql/language/nodes.rb', line 1902
def fields
@fields
end
|
#interfaces ⇒ Object
1898
1899
1900
|
# File 'lib/graphql/language/nodes.rb', line 1898
def interfaces
@interfaces
end
|
#name ⇒ Object
1891
1892
1893
|
# File 'lib/graphql/language/nodes.rb', line 1891
def name
@name
end
|
Class Method Details
.from_a(filename, line, col, name, interfaces, directives, fields, comment: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
1944
1945
1946
|
# File 'lib/graphql/language/nodes.rb', line 1944
def self.from_a(filename, line, col, name, interfaces, directives, fields, comment: nil) self.new(filename: filename, line: line, col: col, name: name, interfaces: interfaces, directives: directives, fields: fields)
end
|
Instance Method Details
#children ⇒ Object
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
|
# File 'lib/graphql/language/nodes.rb', line 1916
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
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
|
# File 'lib/graphql/language/nodes.rb', line 1948
def marshal_dump
[
line, col, @filename,
@name,
@interfaces,
@directives,
@fields,
]
end
|
#marshal_load(values) ⇒ Object
1959
1960
1961
|
# File 'lib/graphql/language/nodes.rb', line 1959
def marshal_load(values)
@line, @col, @filename, @name, @interfaces, @directives, @fields = values
end
|
#merge_directive(**node_opts) ⇒ Object
1908
1909
1910
|
# File 'lib/graphql/language/nodes.rb', line 1908
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
1904
1905
1906
|
# File 'lib/graphql/language/nodes.rb', line 1904
def merge_interface(**node_opts)
merge(interfaces: interfaces + [GraphQL::Language::Nodes::TypeName.new(**node_opts)])
end
|
#scalars ⇒ Object
1893
1894
1895
|
# File 'lib/graphql/language/nodes.rb', line 1893
def scalars
@scalars ||= [@name].freeze
end
|
#visit_method ⇒ Object
1886
1887
1888
|
# File 'lib/graphql/language/nodes.rb', line 1886
def visit_method
:on_interface_type_extension
end
|