Sha256: dc8c4d9200eca7e04d44318e5a4caf00f00e49397c877efd0e090ff1b934a714

Contents?: true

Size: 662 Bytes

Versions: 52

Compression:

Stored size: 662 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

describe GraphQL::StaticValidation::NoDefinitionsArePresent do
  include StaticValidationHelpers
  describe "when schema definitions are present in the query" do
    let(:query_string) {
      <<-GRAPHQL
      {
        cheese(id: 1) { flavor }
      }

      type Thing {
        stuff: Int
      }

      scalar Date
      GRAPHQL
    }

    it "adds an error" do
      assert_equal 1, errors.length
      err = errors[0]
      assert_equal "Query cannot contain schema definitions", err["message"]
      assert_equal [{"line"=>5, "column"=>7}, {"line"=>9, "column"=>7}], err["locations"]
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
graphql-1.7.8 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre2 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.7 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre1 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.6 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.5 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.4 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.3 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.2 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.1 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.0 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.8 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.7 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.6 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.5 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.4 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.5.15 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.3 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.2 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.6.1 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb