-
Notifications
You must be signed in to change notification settings - Fork 79
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
Got null data in subscription callback if data is changed inside a lambda function #2974
Comments
Hi @nam-truong-le can you provide the selection set of the outgoing mutation that is meant to trigger the subscription? I'm curious to see what fields the mutation returns and what fields the subscription is expecting. There might be some conflict between them that is potentially causing an error that makes it seem like the data is You can verify this by checking the network tab, filtering for |
This is my selection set: const SELECTION = [
"id",
"number",
"status",
"billingItems.*",
"summary.*",
"data.*",
"data.applicants.*",
"data.billing.*",
"data.options.*",
"paymentLink",
"secret",
"createdAt",
"updatedAt",
"paidAt",
"paymentMethod",
] as const; |
@nam-truong-le were you able to check the subscription messages in the network logs? Also, i noticed your selection set is expecting relational data. Maybe try removing the relational fields. Gen 2 automatically redacts relational data from mutations. That might be causing some conflict with the subscription. Try only getting the top level, non-relational fields on the model. |
I will try.
I don't have relational fields, they are just custom types. |
@nam-truong-le can you check the outgoing mutation and what fields are in its selection set, then compare that to the fields the subscription has in its selection set? please share them as well. curious to see if there is a mismatch between them. the mutation selection set should be at least a subset of the subscription's. |
I return full object in mutation and the select set is a sub set of it. |
@nam-truong-le are you able to share what the mutation selection set looks like for us to reproduce the issue more accurately? i'm not sure what you mean by "full object." it would help to have the full schema for that model as well. I'm also curious if you have tried using the subscription + mutation in the appsync console? or if you have tried the subscription with different or no selection sets. |
Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you. Thank you! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
How did you install the Amplify CLI?
pnpm
If applicable, what version of Node.js are you using?
20
Amplify CLI Version
1.2.9
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
I follow this Grant Lambda function access to API and Data to update data inside a lambda function.
My subscription in UI is triggered but it gets null data:
Expected behavior
The callback in the UI should get data.
Reproduction steps
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: