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.19.3 lib/graphql/introspection/typename_field.rb
graphql-0.19.2 lib/graphql/introspection/typename_field.rb
graphql-0.19.1 lib/graphql/introspection/typename_field.rb
graphql-0.19.0 lib/graphql/introspection/typename_field.rb
graphql-0.18.15 lib/graphql/introspection/typename_field.rb
graphql-0.18.14 lib/graphql/introspection/typename_field.rb
graphql-0.18.13 lib/graphql/introspection/typename_field.rb
graphql-0.18.12 lib/graphql/introspection/typename_field.rb
graphql-0.18.11 lib/graphql/introspection/typename_field.rb
graphql-0.18.10 lib/graphql/introspection/typename_field.rb
graphql-0.18.9 lib/graphql/introspection/typename_field.rb
graphql-0.18.8 lib/graphql/introspection/typename_field.rb
graphql-0.18.7 lib/graphql/introspection/typename_field.rb
graphql-0.18.6 lib/graphql/introspection/typename_field.rb
graphql-0.18.5 lib/graphql/introspection/typename_field.rb
graphql-0.18.4 lib/graphql/introspection/typename_field.rb
graphql-0.18.3 lib/graphql/introspection/typename_field.rb
graphql-0.18.2 lib/graphql/introspection/typename_field.rb
graphql-0.18.1 lib/graphql/introspection/typename_field.rb
graphql-0.18.0 lib/graphql/introspection/typename_field.rb