Skip to content

Commit

Permalink
Add note about empty strings now throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Oct 13, 2021
1 parent b4e2a7f commit 779b318
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion .changeset/gentle-plums-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@keystone-next/keystone': major
---

Removed the deprecated `resolveFields` from `context.query`, if you were still using it, you should switch to providing `the query option` to `context.query` or use `context.db` if you were providing `false`.
Removed the deprecated `resolveFields` from `context.query`, if you were still using it, you should switch to providing `the query option` to `context.query` or use `context.db` if you were providing `false`. The `context.query` functions will now also throw an error if an empty string is passed to `query` rather than silently returning what the `context.db` functions return, you must select at least one field or omit the `query` option to default to selecting the `id`.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const crudTests = (keystoneTestWrapper: any) => {
await expect(
context.query.Test.createOne({
data: { passwordRejectCommon: 'password' },
query: ``,
})
).rejects.toMatchInlineSnapshot(`
[GraphQLError: You provided invalid data for this operation.
Expand Down

0 comments on commit 779b318

Please sign in to comment.