Sha256: 5dfe67d3364bf2a6831f7ba83b979b24ce062d506a093da1a89998fea1fccf8c

Contents?: true

Size: 1.01 KB

Versions: 62

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true
module GraphQL
  module Introspection
    class FieldType < Introspection::BaseObject
      graphql_name "__Field"
      description "Object and Interface types are described by a list of Fields, each of which has "\
                  "a name, potentially a list of arguments, and a return type."
      field :name, String, null: false
      field :description, String
      field :args, [GraphQL::Schema::LateBoundType.new("__InputValue")], null: false, scope: false do
        argument :include_deprecated, Boolean, required: false, default_value: false
      end
      field :type, GraphQL::Schema::LateBoundType.new("__Type"), null: false
      field :is_deprecated, Boolean, null: false
      field :deprecation_reason, String

      def is_deprecated
        !!@object.deprecation_reason
      end

      def args(include_deprecated:)
        args = @context.warden.arguments(@object)
        args = args.reject(&:deprecation_reason) unless include_deprecated
        args
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
graphql-2.1.15 lib/graphql/introspection/field_type.rb
graphql-1.13.24 lib/graphql/introspection/field_type.rb
graphql-2.0.32 lib/graphql/introspection/field_type.rb
graphql-2.1.14 lib/graphql/introspection/field_type.rb
graphql-2.2.17 lib/graphql/introspection/field_type.rb
graphql-2.2.16 lib/graphql/introspection/field_type.rb
graphql-2.1.13 lib/graphql/introspection/field_type.rb
graphql-2.3.7 lib/graphql/introspection/field_type.rb
graphql-2.3.6 lib/graphql/introspection/field_type.rb
graphql-2.3.5 lib/graphql/introspection/field_type.rb
graphql-2.0.31 lib/graphql/introspection/field_type.rb
graphql-2.3.2 lib/graphql/introspection/field_type.rb
graphql-2.3.1 lib/graphql/introspection/field_type.rb
graphql-1.13.23 lib/graphql/introspection/field_type.rb
graphql-2.3.0 lib/graphql/introspection/field_type.rb
graphql-2.2.14 lib/graphql/introspection/field_type.rb
graphql-2.2.13 lib/graphql/introspection/field_type.rb
graphql-2.2.12 lib/graphql/introspection/field_type.rb
graphql-2.0.29 lib/graphql/introspection/field_type.rb
graphql-2.1.12 lib/graphql/introspection/field_type.rb