Sha256: 8f1ea135c4aec7e9f98784d0dab198508a2a4eb4aeaeb305c8354f300fb3df90

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
graphql-0.9.2 spec/graphql/introspection/directive_type_spec.rb
graphql-0.8.1 spec/graphql/introspection/directive_type_spec.rb
graphql-0.8.0 spec/graphql/introspection/directive_type_spec.rb
graphql-0.7.1 spec/graphql/introspection/directive_type_spec.rb
graphql-0.7.0 spec/graphql/introspection/directive_type_spec.rb
graphql-0.6.2 spec/graphql/introspection/directive_type_spec.rb
graphql-0.6.1 spec/graphql/introspection/directive_type_spec.rb
graphql-0.6.0 spec/graphql/introspection/directive_type_spec.rb
graphql-0.5.0 spec/graph_ql/introspection/directive_type_spec.rb
graphql-0.4.0 spec/graph_ql/introspection/directive_type_spec.rb
graphql-0.3.0 spec/graph_ql/introspection/directive_type_spec.rb