Class: GraphQL::Language::Nodes::SchemaDefinition
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::SchemaDefinition
- Defined in:
- lib/graphql/language/nodes.rb
Constant Summary
Constants inherited from AbstractNode
Instance Attribute Summary collapse
-
#directives ⇒ Object
(also: #children)
readonly
: Array.
-
#mutation ⇒ Object
readonly
: String?.
-
#query ⇒ Object
readonly
: String?.
-
#subscription ⇒ Object
readonly
: String?.
Attributes inherited from AbstractNode
Class Method Summary collapse
-
.from_a(filename, line, col, query, mutation, subscription, directives, comment: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Summary collapse
-
#initialize(query: nil, mutation: nil, subscription: nil, directives: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil) ⇒ SchemaDefinition
constructor
: (?query: untyped, ?mutation: untyped, ?subscription: untyped, ?directives: 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
- #scalars ⇒ Object
- #visit_method ⇒ Object
Methods inherited from AbstractNode
#==, #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(query: nil, mutation: nil, subscription: nil, directives: NO_CHILDREN, line: nil, col: nil, pos: nil, filename: nil, source: nil, definition_pos: nil) ⇒ SchemaDefinition
: (?query: untyped, ?mutation: untyped, ?subscription: untyped, ?directives: Array, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped, ?definition_pos: Integer?) -> void
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 |
# File 'lib/graphql/language/nodes.rb', line 1235 def initialize(query: nil, mutation: nil, subscription: nil, directives: 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 @query = query @mutation = mutation @subscription = subscription @directives = directives.freeze @definition_pos = definition_pos end |
Instance Attribute Details
#directives ⇒ Object (readonly) Also known as: children
: Array
1226 1227 1228 |
# File 'lib/graphql/language/nodes.rb', line 1226 def directives @directives end |
#mutation ⇒ Object (readonly)
: String?
1217 1218 1219 |
# File 'lib/graphql/language/nodes.rb', line 1217 def mutation @mutation end |
#query ⇒ Object (readonly)
: String?
1215 1216 1217 |
# File 'lib/graphql/language/nodes.rb', line 1215 def query @query end |
#subscription ⇒ Object (readonly)
: String?
1219 1220 1221 |
# File 'lib/graphql/language/nodes.rb', line 1219 def subscription @subscription end |
Class Method Details
.from_a(filename, line, col, query, mutation, subscription, directives, comment: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
1248 1249 1250 |
# File 'lib/graphql/language/nodes.rb', line 1248 def self.from_a(filename, line, col, query, mutation, subscription, directives, comment: nil) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, query: query, mutation: mutation, subscription: subscription, directives: directives) end |
Instance Method Details
#marshal_dump ⇒ Object
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 |
# File 'lib/graphql/language/nodes.rb', line 1252 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @query, @mutation, @subscription, @directives, ] end |
#marshal_load(values) ⇒ Object
1263 1264 1265 |
# File 'lib/graphql/language/nodes.rb', line 1263 def marshal_load(values) @line, @col, @filename, @query, @mutation, @subscription, @directives = values end |
#merge_directive(**node_opts) ⇒ Object
1228 1229 1230 |
# File 'lib/graphql/language/nodes.rb', line 1228 def merge_directive(**node_opts) merge(directives: directives + [GraphQL::Language::Nodes::Directive.new(**node_opts)]) end |
#scalars ⇒ Object
1221 1222 1223 |
# File 'lib/graphql/language/nodes.rb', line 1221 def scalars @scalars ||= [@query, @mutation, @subscription].freeze end |
#visit_method ⇒ Object
1210 1211 1212 |
# File 'lib/graphql/language/nodes.rb', line 1210 def visit_method :on_schema_definition end |