Method: GraphQL::Schema#root_type_for_operation

Defined in:
lib/graphql/schema.rb

#root_type_for_operation(operation) ⇒ GraphQL::ObjectType?

Returns:

See Also:

  • Resticted access to root types


355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/graphql/schema.rb', line 355

def root_type_for_operation(operation)
  case operation
  when "query"
    query
  when "mutation"
    mutation
  when "subscription"
    subscription
  else
    raise ArgumentError, "unknown operation type: #{operation}"
  end
end