lib/graphql/schema.rb
# Determine the GraphQL type for a given object.
# This is required for unions and interfaces (including Relay's `Node` interface)
# @see [GraphQL::Schema::Warden] Restricted access to members of a schema
# @param type [GraphQL::UnionType, GraphQL:InterfaceType] the abstract type which is being resolved
# @param object [Any] An application object which GraphQL is currently resolving on
# @param ctx [GraphQL::Query::Context] The context for the current query
# @return [GraphQL::ObjectType] The type for exposing `object` in GraphQL
Determine the GraphQL type for a given object.
This is required for unions and interfaces (including Relay's `Node` interface)
Determine the GraphQL type for a given object . This is required for unions and interfaces ( including Relay ' s ` Node ` interface )
def resolve_type(type, object, ctx = :__undefined__)
      check_resolved_type(type, object, ctx) do |ok_type, ok_object, ok_ctx|
        if @resolve_type_proc.nil?
          raise(GraphQL::RequiredImplementationMissingError, "Can't determine GraphQL type for: #{ok_object.inspect}, define `resolve_type (type, obj, ctx) -> { ... }` inside `Schema.define`.")
        end
        @resolve_type_proc.call(ok_type, ok_object, ok_ctx)
      end
    end
def resolve_type ( type , object , ctx = :__undefined__ ) check_resolved_type ( type , object , ctx ) do | ok_type , ok_object , ok_ctx | if @resolve_type_proc . nil? raise ( GraphQL :: RequiredImplementationMissingError , "Can't determine GraphQL type for: #{ok_object.inspect}, define `resolve_type (type, obj, ctx) -> { ... }` inside `Schema.define`." ) end @resolve_type_proc . call ( ok_type , ok_object , ok_ctx ) end end
Determine the GraphQL type for a given object.
Determine the GraphQL type for a given object .
The type for exposing `object` in GraphQL
The type for exposing ` object ` in GraphQL
GraphQL::ObjectType
type
the abstract type which is being resolved
the abstract type which is being resolved
object
An application object which GraphQL is currently resolving on
An application object which GraphQL is currently resolving on
ctx
The context for the current query
The context for the current query
see
[GraphQL::Schema::Warden] Restricted access to members of a schema
[ GraphQL :: Schema :: Warden ] Restricted access to members of a schema