Sha256: f86995ca45e8639769c60c9e9b2f46a9a9cc4ef252dacb0124ddee36cc2f3d31

Contents?: true

Size: 931 Bytes

Versions: 76

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

describe GraphQL::StaticValidation::DirectivesAreDefined do
  include StaticValidationHelpers
  let(:query_string) {"
    query getCheese {
      okCheese: cheese(id: 1) {
        id @skip(if: true),
        source @nonsense(if: false)
        ... on Cheese {
          flavor @moreNonsense
        }
      }
    }
  "}
  describe "non-existent directives" do
    it "makes errors for them" do
      expected = [
        {
          "message"=>"Directive @nonsense is not defined",
          "locations"=>[{"line"=>5, "column"=>16}],
          "fields"=>["query getCheese", "okCheese", "source"],
        }, {
          "message"=>"Directive @moreNonsense is not defined",
          "locations"=>[{"line"=>7, "column"=>18}],
          "fields"=>["query getCheese", "okCheese", "... on Cheese", "flavor"],
        }
      ]
      assert_equal(expected, errors)
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
graphql-1.8.18 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.17 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.16 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.15 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.14 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.13 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.12 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.9.0.pre1 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.11 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.10 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.9 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.8 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.7 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.6 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.5 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.4 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.3 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.2 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.1 spec/graphql/static_validation/rules/directives_are_defined_spec.rb
graphql-1.8.0 spec/graphql/static_validation/rules/directives_are_defined_spec.rb