Sha256: 4bd3ab4d4f1d3ebf181bcf0e3f3b6a18728a9f0f6e47bfb10ed6afd64eb0153b

Contents?: true

Size: 467 Bytes

Versions: 13

Compression:

Stored size: 467 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.fetch(args["name"], nil) }
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql-0.19.3 lib/graphql/introspection/type_by_name_field.rb
graphql-0.19.2 lib/graphql/introspection/type_by_name_field.rb
graphql-0.19.1 lib/graphql/introspection/type_by_name_field.rb
graphql-0.19.0 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.15 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.14 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.13 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.12 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.11 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.10 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.9 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.8 lib/graphql/introspection/type_by_name_field.rb
graphql-0.18.7 lib/graphql/introspection/type_by_name_field.rb