Sha256: 58ced45bf728042bea56de12b4abcdac80473b6e15a97c4849f20c92c90e9355

Contents?: true

Size: 790 Bytes

Versions: 7

Compression:

Stored size: 790 Bytes

Contents

GraphQL::Introspection::InputValueType = GraphQL::ObjectType.define do
  name "__InputValue"
  description "Arguments provided to Fields or Directives and the input fields of an "\
              "InputObject are represented as Input Values which describe their type and "\
              "optionally a default value."
  field :name, !types.String
  field :description, types.String
  field :type, !GraphQL::Introspection::TypeType
  field :defaultValue, types.String, "A GraphQL-formatted string representing the default value for this input value." do
    resolve ->(obj, args, ctx) {
      if obj.default_value?
        value = obj.default_value
        value.nil? ? 'null' : JSON.generate(obj.type.coerce_result(value), quirks_mode: true)
      else
        nil
      end
    }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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