Sha256: c361793f6eebdb3a9b9b42e41d0812b6185432324e35593fcaf9be50e3c12878

Contents?: true

Size: 608 Bytes

Versions: 15

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true
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}],
      "path"=>["fragment "],
      "extensions"=>{"code"=>"anonymousFragment"}
    }
    assert_includes(errors, fragment_def_error, "on fragment definitions")
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
graphql-1.9.11 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.10 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.9 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.8 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.7 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.6 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.5 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.4 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.3 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.2 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.1 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.0 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.0.pre4 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.0.pre3 spec/graphql/static_validation/rules/fragments_are_named_spec.rb
graphql-1.9.0.pre2 spec/graphql/static_validation/rules/fragments_are_named_spec.rb