Sha256: 73a3d229a3e8ce800af36b662e492f6ec3db95b70e039eb8d1f60ee45ff539a0

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require "spec_helper"


describe GraphQL::Introspection::InputValueType do
  let(:query_string) {%|
     {
       __type(name: "DairyProductInput") {
         name,
         description,
         kind,
         inputFields {
           name,
           type { name },
           defaultValue
         }
       }
     }
  |}
  let(:result) { DummySchema.execute(query_string)}

  it 'exposes metadata about input objects, giving extra quotes for strings' do
    expected = { "data" => {
        "__type" => {
          "name"=>"DairyProductInput",
          "description"=>"Properties for finding a dairy product",
          "kind"=>"INPUT_OBJECT",
          "inputFields"=>[
            {"name"=>"source", "type"=>{ "name" => "Non-Null"}, "defaultValue"=>nil},
            {"name"=>"originDairy", "type"=>{ "name" => "String"}, "defaultValue"=>"\"Sugar Hollow Dairy\""},
            {"name"=>"fatContent", "type"=>{ "name" => "Float"}, "defaultValue"=>nil}
          ]
        }
      }}
    assert_equal(expected, result)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphql-0.12.1 spec/graphql/introspection/input_value_type_spec.rb
graphql-0.12.0 spec/graphql/introspection/input_value_type_spec.rb