Skip to content

Commit 67e22af

Browse files
committed
Add test for each way of using a query_string
1 parent aef9527 commit 67e22af

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec/graphql/query_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
let(:result) { query.result }
4646

4747
describe "when passed both a query string and a document" do
48-
it "returns an error to the client" do
48+
it "returns an error to the client when query kwarg is used" do
4949
assert_raises ArgumentError do
5050
GraphQL::Query.new(
5151
schema,
@@ -54,6 +54,16 @@
5454
)
5555
end
5656
end
57+
58+
it "returns an error to the client" do
59+
assert_raises ArgumentError do
60+
GraphQL::Query.new(
61+
schema,
62+
"{ fromSource(source: COW) { id } }",
63+
document: document
64+
)
65+
end
66+
end
5767
end
5868

5969
describe "when passed no query string or document" do

0 commit comments

Comments
 (0)