Sha256: b086cbe0fb5b11caf837ed3ba33b358400cc641342a772bcca1b16087949c96f

Contents?: true

Size: 1.02 KB

Versions: 34

Compression:

Stored size: 1.02 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, null: true
      field :args, [GraphQL::Schema::LateBoundType.new("__InputValue")], null: 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, null: true

      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

34 entries across 34 versions & 1 rubygems

Version Path
graphql-1.11.12 lib/graphql/introspection/field_type.rb
graphql-1.11.11 lib/graphql/introspection/field_type.rb
graphql-1.12.25 lib/graphql/introspection/field_type.rb
graphql-1.12.24 lib/graphql/introspection/field_type.rb
graphql-1.12.23 lib/graphql/introspection/field_type.rb
graphql-1.12.22 lib/graphql/introspection/field_type.rb
graphql-1.12.21 lib/graphql/introspection/field_type.rb
graphql-1.12.20 lib/graphql/introspection/field_type.rb
graphql-1.12.19 lib/graphql/introspection/field_type.rb
graphql-1.11.10 lib/graphql/introspection/field_type.rb
graphql-1.12.18 lib/graphql/introspection/field_type.rb
graphql-1.11.9 lib/graphql/introspection/field_type.rb
graphql-1.12.17 lib/graphql/introspection/field_type.rb
graphql-1.12.16 lib/graphql/introspection/field_type.rb
graphql-1.12.15 lib/graphql/introspection/field_type.rb
graphql-1.12.14 lib/graphql/introspection/field_type.rb
graphql-1.12.13 lib/graphql/introspection/field_type.rb
graphql-1.12.12 lib/graphql/introspection/field_type.rb
graphql-1.12.11 lib/graphql/introspection/field_type.rb
graphql-1.12.10 lib/graphql/introspection/field_type.rb