Sha256: 6541d24a80cd1802d0d356c0f0f4ccc8214b771b50d30b4617fdb58f793ae0d7

Contents?: true

Size: 429 Bytes

Versions: 4

Compression:

Stored size: 429 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
    return nil if !object.kind.enum?
    fields = object.values.values
    if !arguments["includeDeprecated"]
      fields = fields.select {|f| !f.deprecation_reason }
    end
    fields
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
graphql-0.19.3 lib/graphql/introspection/enum_values_field.rb
graphql-0.19.2 lib/graphql/introspection/enum_values_field.rb
graphql-0.19.1 lib/graphql/introspection/enum_values_field.rb
graphql-0.19.0 lib/graphql/introspection/enum_values_field.rb