Sha256: b2e5295902891e2ac46e3d55487a2f01e98666d836fecf3e242451c02b259a04

Contents?: true

Size: 490 Bytes

Versions: 8

Compression:

Stored size: 490 Bytes

Contents

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

8 entries across 8 versions & 1 rubygems

Version Path
graphql-1.2.6 lib/graphql/introspection/enum_values_field.rb
graphql-1.2.5 lib/graphql/introspection/enum_values_field.rb
graphql-1.2.4 lib/graphql/introspection/enum_values_field.rb
graphql-1.2.3 lib/graphql/introspection/enum_values_field.rb
graphql-1.2.2 lib/graphql/introspection/enum_values_field.rb
graphql-1.2.1 lib/graphql/introspection/enum_values_field.rb
graphql-1.2.0 lib/graphql/introspection/enum_values_field.rb
graphql-1.1.0 lib/graphql/introspection/enum_values_field.rb