-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
indexQueryFactory tries to run Object.keys(null) what causes error #13941
Comments
@chachasammy is it a scam? @aws-amplify-ops Could you ban it? |
@WojciechKasprzyk Thanks for calling that out! Deleted/reported. |
Hi @WojciechKasprzyk 👋 thanks for raising this issue and we've taken action against the comment you pointed out. Regarding this issue, we will reproduce with the conditions you mentioned and look into addressing it |
Hi @WojciechKasprzyk just curious, could you share the server code that is returning potentially |
Hi @chrisbonifacio Unfortunately I cannot, but as far as I know there is a model issue the causes API error an then responses null data. |
@WojciechKasprzyk I'm trying to figure out how to reproduce the behavior so we can address it but I can't think of a scenario where a |
oh okay, I believe that particular error message means that the query is asking for fields that don't exist on the schema. Can you confirm that |
Yes, they are both type of id on the |
Is that schema deployed and up to date in the AppSync console? |
it was not in sync, now there is no this error - I get different ehhh... 😄 But still the condition in amplify codebase is invalid |
We will look into the discrepancy in the codebase. In the meantime, are you getting a different error now or are you unblocked at this time? |
Oh, I'm unblocked at this time, thank you very much @chrisbonifacio for helping me, I really appreciate 😄 |
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
Amplify Gen 2
Environment information
Describe the bug
If API return data equals null then indexQueryFactory tries to run Object.keys(null) which causes error. It's funny that you mentioned in the comment that data can be null and you mentioned that you check it but actually, it is not.
null !== undefined so Object.keys is called with invalid argument.
Expected behavior
There should be a condition like
data != null
to check both null and undefined.Reproduction steps
Call API that returns data: null
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: