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.8.4 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.3 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.2 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.1 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre11 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre10 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.14 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre9 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre8 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.13 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre7 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.12 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.11 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.10 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre6 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre5 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.7.9 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre4 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb
graphql-1.8.0.pre3 spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb