Class: GraphqlRails::Router::SchemaBuilder
- Inherits:
-
Object
- Object
- GraphqlRails::Router::SchemaBuilder
- Defined in:
- lib/graphql_rails/router/schema_builder.rb
Overview
builds GraphQL::Schema based on previously defined grahiti data
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#mutations ⇒ Object
readonly
Returns the value of attribute mutations.
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
-
#raw_actions ⇒ Object
readonly
Returns the value of attribute raw_actions.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(queries:, mutations:, events:, raw_actions:, group: nil) ⇒ SchemaBuilder
constructor
A new instance of SchemaBuilder.
Constructor Details
#initialize(queries:, mutations:, events:, raw_actions:, group: nil) ⇒ SchemaBuilder
Returns a new instance of SchemaBuilder.
12 13 14 15 16 17 18 |
# File 'lib/graphql_rails/router/schema_builder.rb', line 12 def initialize(queries:, mutations:, events:, raw_actions:, group: nil) @queries = queries @mutations = mutations @events = events @raw_actions = raw_actions @group = group end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
10 11 12 |
# File 'lib/graphql_rails/router/schema_builder.rb', line 10 def events @events end |
#mutations ⇒ Object (readonly)
Returns the value of attribute mutations.
10 11 12 |
# File 'lib/graphql_rails/router/schema_builder.rb', line 10 def mutations @mutations end |
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
10 11 12 |
# File 'lib/graphql_rails/router/schema_builder.rb', line 10 def queries @queries end |
#raw_actions ⇒ Object (readonly)
Returns the value of attribute raw_actions.
10 11 12 |
# File 'lib/graphql_rails/router/schema_builder.rb', line 10 def raw_actions @raw_actions end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/graphql_rails/router/schema_builder.rb', line 20 def call query_type = build_group_type('Query', queries) mutation_type = build_group_type('Mutation', mutations) subscription_type = build_group_type('Subscription', events) define_schema_class(query_type, mutation_type, subscription_type, raw_actions) end |