Open WojciechKasprzyk opened 2 days ago
@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 null
values? I'm curious if this is caused by an auto-generated query/mutation of ours or if it is custom business logic in a custom query/mutation.
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. Anyway, what does it change? The code should be prepared for null as it is described in comment 😄
@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 null
might be in the response. Is the shape of the response an array of items and some null
values in the array? Or is the server returning only null
?
This is the response I get
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 parentGci
and parentChannelID
are defined as fields on the Category
model?
Yes, they are both type of id on the Category
model
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
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