Sha256: 4c6e260f246f21ee10c341d51027500f7233385cc8f82375c9e9050b7c4f1a72

Contents?: true

Size: 1023 Bytes

Versions: 36

Compression:

Stored size: 1023 Bytes

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 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

36 entries across 36 versions & 2 rubygems

Version Path
graphql-1.13.18 lib/graphql/introspection/field_type.rb
graphql-2.0.16 lib/graphql/introspection/field_type.rb
graphql-1.13.17 lib/graphql/introspection/field_type.rb
graphql-2.0.15 lib/graphql/introspection/field_type.rb
graphql-2.0.14 lib/graphql/introspection/field_type.rb
graphql-1.13.16 lib/graphql/introspection/field_type.rb
graphql-2.0.13 lib/graphql/introspection/field_type.rb
graphql-2.0.12 lib/graphql/introspection/field_type.rb
graphql-1.13.15 lib/graphql/introspection/field_type.rb
graphql-2.0.11 lib/graphql/introspection/field_type.rb
graphql-1.13.14 lib/graphql/introspection/field_type.rb
graphql-1.13.13 lib/graphql/introspection/field_type.rb
graphql-2.0.9 lib/graphql/introspection/field_type.rb
graphql-2.0.8 lib/graphql/introspection/field_type.rb
graphql-2.0.7 lib/graphql/introspection/field_type.rb
graphql_cody-1.13.0 lib/graphql/introspection/field_type.rb
graphql-1.13.12 lib/graphql/introspection/field_type.rb
graphql-2.0.6 lib/graphql/introspection/field_type.rb
graphql-2.0.5 lib/graphql/introspection/field_type.rb
graphql-2.0.4 lib/graphql/introspection/field_type.rb