Skip to content

Commit

Permalink
test: Add test for querying undefined field (#544)
Browse files Browse the repository at this point in the history
Add test for querying undefined field
  • Loading branch information
AndrewSisley authored Jun 21, 2022
1 parent 0126567 commit 970f887
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/integration/query/simple/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,18 @@ func TestQuerySimpleWithMultipleRows(t *testing.T) {

executeTestCase(t, test)
}

func TestQuerySimpleWithUndefinedField(t *testing.T) {
test := testUtils.QueryTestCase{
Description: "Simple query for undefined field",
Query: `query {
users {
Name
ThisFieldDoesNotExists
}
}`,
ExpectedError: "Cannot query field \"ThisFieldDoesNotExists\" on type \"users\".",
}

executeTestCase(t, test)
}

0 comments on commit 970f887

Please sign in to comment.