Sha256: 7561dbc28952f0004cf1a65738a9a448ec28dd88146728c6c2dc3788b8e66a5b

Contents?: true

Size: 457 Bytes

Versions: 20

Compression:

Stored size: 457 Bytes

Contents

module GraphQL
  module Introspection
    # A wrapper to create `__type(name: )` dynamically.
    class TypeByNameField
      def self.create(type_hash)
        GraphQL::Field.define do
          name("__type")
          description("A type in the GraphQL system")
          type(!GraphQL::Introspection::TypeType)
          argument :name, !types.String
          resolve -> (o, args, c) { type_hash[args["name"]] }
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
graphql-0.18.6 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.5 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.4 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.3 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.2 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.1 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.0 lib/graphql/introspection/type_by_name_field.rb
graphql-0.17.2 lib/graphql/introspection/type_by_name_field.rb
graphql-0.17.1 lib/graphql/introspection/type_by_name_field.rb
graphql-0.17.0 lib/graphql/introspection/type_by_name_field.rb
graphql-0.16.1 lib/graphql/introspection/type_by_name_field.rb
graphql-0.16.0 lib/graphql/introspection/type_by_name_field.rb
graphql-0.15.3 lib/graphql/introspection/type_by_name_field.rb
graphql-0.15.2 lib/graphql/introspection/type_by_name_field.rb
graphql-0.14.2 lib/graphql/introspection/type_by_name_field.rb
graphql-0.15.1 lib/graphql/introspection/type_by_name_field.rb
graphql-0.15.0 lib/graphql/introspection/type_by_name_field.rb
graphql-0.14.1 lib/graphql/introspection/type_by_name_field.rb
graphql-0.14.0 lib/graphql/introspection/type_by_name_field.rb
graphql-0.13.0 lib/graphql/introspection/type_by_name_field.rb