-
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
TypeError: "Cannot convert null value to object" - AppSync Filters Not Matching Typescript Filters on SecondaryIndex #13392
Comments
Hi @ChristopherGabba, thank you for raising this issue. I was able to consistently reproduce this issue on the latest version of It seems that Trying to use |
@chrisbonifacio great, glad you were able to identify this. I don't think this issue should be closed yet though. I believe Typescripts intellisense still recommends And Typescript recommends these: So there is clearly a disconnect. Typescript shouldn't be showing me these options if they aren't possible. Personally, I really like all the options Typescript suggests and wish AppSync wouldn't limit sortKeys to just those 7. Why would the sortKey allow Additionally, I would REALLY like this error to not be "TypeError: Cannot convert null value to object" and it should be "Incompatible Filter Applied - AttributeExistFilter is not supported" or something more reasonible. This error took me a few hours to debug. Honestly even the error in your AppSync screenshot is way better lol... |
@ChristopherGabba thank you for pointing this out, totally went over my head when I was reproducing! That would certainly make this a bug Just double checked and see there is a discrepancy between the schema generated by the transformer: The transformed type uses which is correct but the intellisense is still showing more options than it should Seems to be confusing it with |
Awesome, yeah this probably explains why I keep getting all these TypeErrors with the new GraphQL format... lol |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
Amplify Gen 2 (Preview)
Environment information
Describe the bug
I have a secondaryIndex query set up in AWS Amplify Gen 2. The query throws the error above when the sortKey is set like so:
Expected behavior
Should not throw this error
Reproduction steps
See code above
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
iPhone 12 Physical
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
Expo 51, React Native 0.74.
The text was updated successfully, but these errors were encountered: