Sha256: 4ad1d5ed8906207ef283d68ecb3682eec0021e4330bab041f52be0c2b6bda06a

Contents?: true

Size: 1.01 KB

Versions: 18

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.types.arguments(@object)
        args = args.reject(&:deprecation_reason) unless include_deprecated
        args
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
graphql-2.4.4 lib/graphql/introspection/field_type.rb
graphql-2.4.3 lib/graphql/introspection/field_type.rb
graphql-2.4.2 lib/graphql/introspection/field_type.rb
graphql-2.4.1 lib/graphql/introspection/field_type.rb
graphql-2.4.0 lib/graphql/introspection/field_type.rb
graphql-2.3.20 lib/graphql/introspection/field_type.rb
graphql-2.3.19 lib/graphql/introspection/field_type.rb
graphql-2.3.18 lib/graphql/introspection/field_type.rb
graphql-2.3.17 lib/graphql/introspection/field_type.rb
graphql-2.3.16 lib/graphql/introspection/field_type.rb
graphql-2.3.15 lib/graphql/introspection/field_type.rb
graphql-2.3.14 lib/graphql/introspection/field_type.rb
graphql-2.3.13 lib/graphql/introspection/field_type.rb
graphql-2.3.12 lib/graphql/introspection/field_type.rb
graphql-2.3.11 lib/graphql/introspection/field_type.rb
graphql-2.3.10 lib/graphql/introspection/field_type.rb
graphql-2.3.9 lib/graphql/introspection/field_type.rb
graphql-2.3.8 lib/graphql/introspection/field_type.rb