Sha256: 3a719e409fafd0cab87fc588d056ecd8d7d2ece6b1b3194b0ab216e524a09bf2

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

GraphQL::Introspection::FieldsField = GraphQL::Field.new do |f, type, field, arg|
  f.description "List of fields on this object"
  f.type -> { type[!GraphQL::Introspection::FieldType] }
  f.arguments({
    includeDeprecated: arg.build({type: GraphQL::BOOLEAN_TYPE, default_value: false})
  })
  f.resolve -> (object, arguments, context) {
    fields = object.fields.values
    if !arguments["includeDeprecated"]
      fields = fields.select {|f| !f.deprecation_reason }
    end
    fields
  }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphql-0.3.0 lib/graph_ql/introspection/fields_field.rb
graphql-0.2.0 lib/graph_ql/introspection/fields_field.rb