-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mock: Cannot return null for non-nullable field [Object.id] #2248
Comments
Simulator converted falsy results to an empty object which prevented returning null for fields in connection type and caused graphql validation error when query included a non nullable field fix aws-amplify#2248
Was there a regression that happened to reintroduce this bug? I am currently experiencing this with the following schema:
When pushed, the mutation for |
@Nxtra I gave up using mock for everything except lambda testing. I hope to use it again when it catches up to the features that my amplify project uses. |
I too am running into this issue -- currently on version 4.43.0 |
For anyone running into this issue (on v4.43.0), here's a workaround (pretty hackey but will suffice for now): replace all of your
|
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Describe the bug
When running
amplify mock
there are connections that are not required that are causing the following error to appear when I run the queries, for example:Cannot return null for non-nullable field Utility.id.
The id field on the connected object is non-nullable but the object itself is nullable. This works fine when querying AppSync.
Here's the relevant snippet from my schema:
The mutation to create the record:
The query that will produce the error:
To Reproduce
Steps to reproduce the behavior:
amplify mock
Expected behavior
Show null in query results like AppSync.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: