Sha256: 36af2081a4adbf54a7022e435b5856364f5edb17470e0ee7a9598223904625f8

Contents?: true

Size: 384 Bytes

Versions: 33

Compression:

Stored size: 384 Bytes

Contents

module GraphQL
  module Introspection
    # A wrapper to create `__typename`.
    class TypenameField
      def self.create(wrapped_type)
        GraphQL::Field.define do
          name "__typename"
          description "The name of this type"
          type -> { !GraphQL::STRING_TYPE }
          resolve -> (obj, a, c) { wrapped_type.name }
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
graphql-0.17.2 lib/graphql/introspection/typename_field.rb
graphql-0.17.1 lib/graphql/introspection/typename_field.rb
graphql-0.17.0 lib/graphql/introspection/typename_field.rb
graphql-0.16.1 lib/graphql/introspection/typename_field.rb
graphql-0.16.0 lib/graphql/introspection/typename_field.rb
graphql-0.15.3 lib/graphql/introspection/typename_field.rb
graphql-0.15.2 lib/graphql/introspection/typename_field.rb
graphql-0.14.2 lib/graphql/introspection/typename_field.rb
graphql-0.15.1 lib/graphql/introspection/typename_field.rb
graphql-0.15.0 lib/graphql/introspection/typename_field.rb
graphql-0.14.1 lib/graphql/introspection/typename_field.rb
graphql-0.14.0 lib/graphql/introspection/typename_field.rb
graphql-0.13.0 lib/graphql/introspection/typename_field.rb