Sha256: fae8ee677db192bfc54bffe0b4069e0882260f700e905e7aae77bfcdeb3033e4

Contents?: true

Size: 530 Bytes

Versions: 14

Compression:

Stored size: 530 Bytes

Contents

require "spec_helper"

describe GraphQL::StaticValidation::FragmentTypesExist do
  include StaticValidationHelpers

  let(:query_string) {"
    fragment on Cheese {
      id
      flavor
    }
  "}

  it "finds non-existent types on fragments" do
    assert_equal(1, errors.length)
    fragment_def_error = {
      "message"=>"Fragment definition has no name",
      "locations"=>[{"line"=>2, "column"=>5}],
      "fields"=>["fragment "],
    }
    assert_includes(errors, fragment_def_error, "on fragment definitions")
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
graphql-1.2.6 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.2.5 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.2.4 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.2.3 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.2.2 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.2.1 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.2.0 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.1.0 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.0.0 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-0.19.4 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-0.19.3 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-0.19.2 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-0.19.1 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-0.19.0 spec/graphql/static_validation/rules/fragments_are_named_spec.rb