Sha256: 3eda10557e370113713dcd0f21f887a4736a686a1f17df4b91e664ac9c6f975d

Contents?: true

Size: 316 Bytes

Versions: 26

Compression:

Stored size: 316 Bytes

Contents

# A wrapper to create `__typename`.
class GraphQL::Introspection::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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
graphql-0.12.1 lib/graphql/introspection/typename_field.rb
graphql-0.12.0 lib/graphql/introspection/typename_field.rb
graphql-0.11.1 lib/graphql/introspection/typename_field.rb
graphql-0.11.0 lib/graphql/introspection/typename_field.rb
graphql-0.10.9 lib/graphql/introspection/typename_field.rb
graphql-0.10.8 lib/graphql/introspection/typename_field.rb
graphql-0.10.7 lib/graphql/introspection/typename_field.rb
graphql-0.10.6 lib/graphql/introspection/typename_field.rb
graphql-0.10.5 lib/graphql/introspection/typename_field.rb
graphql-0.10.4 lib/graphql/introspection/typename_field.rb
graphql-0.10.3 lib/graphql/introspection/typename_field.rb
graphql-0.10.2 lib/graphql/introspection/typename_field.rb
graphql-0.10.1 lib/graphql/introspection/typename_field.rb
graphql-0.10.0 lib/graphql/introspection/typename_field.rb
graphql-0.9.5 lib/graphql/introspection/typename_field.rb
graphql-0.9.4 lib/graphql/introspection/typename_field.rb
graphql-0.9.3 lib/graphql/introspection/typename_field.rb
graphql-0.9.2 lib/graphql/introspection/typename_field.rb
graphql-0.8.1 lib/graphql/introspection/typename_field.rb
graphql-0.8.0 lib/graphql/introspection/typename_field.rb