webtau
webtau copied to clipboard
GraphQL - error when asserting on fields not in schema
If one is asserting that a field is null and makes a typo in the field name then the test will always pass even if the field comes back non-null.
We should validate that the assertion is being made against a field which is actually part of the schema. In GraphQL, this will require us to fetch more data via introspection because we need to check for field names in the return objects rather than in the query.
We will also need to provide a way to turn off this behaviour should someone really want to assert something that does not exist in the schema. e.g.
graphql.execute(query) {
suppressUnknownFieldErrors {
somethingNotInSchema.should == 'foo'
}
}
Nice
@tsiq-karold any remaining motivation for this?
@tsiq-karold any remaining motivation for this?
Not right now, no.
closing as not active