Class: GraphqlRails::QueryRunner
- Inherits:
-
Object
- Object
- GraphqlRails::QueryRunner
- Includes:
- Service
- Defined in:
- lib/graphql_rails/query_runner.rb
Overview
executes GraphQL queries and returns json
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params:, context: {}, schema: nil, router: nil, group: nil, **schema_options) ⇒ QueryRunner
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(params:, context: {}, schema: nil, router: nil, group: nil, **schema_options) ⇒ QueryRunner
rubocop:disable Metrics/ParameterLists
11 12 13 14 15 16 17 18 |
# File 'lib/graphql_rails/query_runner.rb', line 11 def initialize(params:, context: {}, schema: nil, router: nil, group: nil, **) # rubocop:disable Metrics/ParameterLists @group = group @graphql_schema = schema @params = params @router = router @initial_context = context @schema_options = end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/graphql_rails/query_runner.rb', line 20 def call graphql_schema.execute( params[:query], variables: variables, operation_name: params[:operationName], context: context, ** ) end |