Sha256: e99fe3a7fe3aaaf3b3e32ada511ec9c4687622a4cb9118d95b5eb15b719048b9

Contents?: true

Size: 1.3 KB

Versions: 27

Compression:

Stored size: 1.3 KB

Contents

require "spec_helper"

describe GraphQL::Introspection::DirectiveType do
  let(:query_string) {%|
    query getDirectives {
      __schema {
        directives {
          name,
          args { name, type { name, ofType { name } } },
          locations
          # Deprecated fields:
          onField
          onFragment
          onOperation
        }
      }
    }
  |}
  let(:result) { DummySchema.execute(query_string) }

  it "shows directive info " do
    expected = { "data" => {
      "__schema" => {
        "directives" => [
          {
            "name" => "skip",
            "args" => [
              {"name"=>"if", "type"=>{"name"=>"Non-Null", "ofType"=>{"name"=>"Boolean"}}}
            ],
            "locations"=>["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"],
            "onField" => true,
            "onFragment" => true,
            "onOperation" => false,
          },
          {
            "name" => "include",
            "args" => [
              {"name"=>"if", "type"=>{"name"=>"Non-Null", "ofType"=>{"name"=>"Boolean"}}}
            ],
            "locations"=>["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"],
            "onField" => true,
            "onFragment" => true,
            "onOperation" => false,
          },
        ]
      }
    }}
    assert_equal(expected, result)
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
graphql-0.18.15 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.14 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.13 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.12 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.11 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.10 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.9 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.8 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.7 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.6 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.5 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.4 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.3 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.2 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.1 spec/graphql/introspection/directive_type_spec.rb
graphql-0.18.0 spec/graphql/introspection/directive_type_spec.rb
graphql-0.17.2 spec/graphql/introspection/directive_type_spec.rb
graphql-0.17.1 spec/graphql/introspection/directive_type_spec.rb
graphql-0.17.0 spec/graphql/introspection/directive_type_spec.rb
graphql-0.16.1 spec/graphql/introspection/directive_type_spec.rb