Sha256: c679abd095f3207df91b2c42418b8ad0ba158fe2074fd7b92edc845fdcb3225b

Contents?: true

Size: 520 Bytes

Versions: 40

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true
GraphQL::Introspection::EnumValuesField = GraphQL::Field.define do
  type types[!GraphQL::Introspection::EnumValueType]
  argument :includeDeprecated, types.Boolean, default_value: false
  resolve ->(object, arguments, context) do
    if !object.kind.enum?
      nil
    else
      enum_values = context.warden.enum_values(object)

      if !arguments["includeDeprecated"]
        enum_values = enum_values.select {|f| !f.deprecation_reason }
      end

      enum_values
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
graphql-1.8.0.pre2 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.7 lib/graphql/introspection/enum_values_field.rb
graphql-1.8.0.pre1 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.6 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.5 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.4 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.3 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.2 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.1 lib/graphql/introspection/enum_values_field.rb
graphql-1.7.0 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.8 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.7 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.6 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.5 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.4 lib/graphql/introspection/enum_values_field.rb
graphql-1.5.15 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.3 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.2 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.1 lib/graphql/introspection/enum_values_field.rb
graphql-1.6.0 lib/graphql/introspection/enum_values_field.rb