Sha256: 89f917c435813c83b085f451d21370be4ec5e449ba2904000e1586b7b798373e

Contents?: true

Size: 638 Bytes

Versions: 69

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

describe GraphQL::StaticValidation::FragmentNamesAreUnique do
  include StaticValidationHelpers

  let(:query_string) {"
    query {
      cheese(id: 1) {
        ... frag1
      }
    }

    fragment frag1 on Cheese { id }
    fragment frag1 on Cheese { id }
  "}

  it "requires unique fragment names" do
    assert_equal(1, errors.length)
    fragment_def_error = {
      "message"=>"Fragment name \"frag1\" must be unique",
      "locations"=>[{"line"=>8, "column"=>5}, {"line"=>9, "column"=>5}],
      "fields"=>[],
    }
    assert_includes(errors, fragment_def_error)
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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