Closed OperationalFallacy closed 10 months ago
@OperationalFallacy, thank you for opening this issue. Did you get a chance to see the v6 Migration Guide (specifically the "API (GraphQL) section)"? The syntax will be difference for any subscriptions and mutations, but if you can share the frontend code that is calling the GraphQL API's that would help too!
I had only one mutation via lambda (below), I've updated it - thanks for pointing out.
Still getting these errors. I believe they are from the code for collections
const response= await client.graphql({
query: requestxxx,
variables: {
input: {
xxx: xxx,
}
}
})
console.log('response', response.data.requestxxx)
// const response: xxxResponse | null = await xxx({
// xxx: xxx,
// });
There is bunch of errors for all models I believe, which is strange because I use only a few in collection - not all. Why is it even complaining about subscription to every model?
Hi @OperationalFallacy can you provide some more relevant code snippets and share the output errors?
I had only one mutation via lambda (below)
Can you explain this a bit more? Are you calling client.graphql
inside of a Lambda function?
Lastly, I'm curious if you have DataStore enabled. Do you see that there are errors for create, update, and delete subscriptions on all models? If DataStore is enabled, that might explain those errors and we can work from there.
Hey @chrisbonifacio, please see that linked ticket. The author mentioned how to patch this bug in the amplify lib. It fixed the problem described here (collection component with datastore enabled). I'm closing this issue in favor of #12590
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
Getting unauthorized for the models that were working ok with v5
For example
Expected behavior
Given the custom mutation with Lambda works, as well as refreshing data (refresh page) - the subscription should be working, too
Reproduction steps
upgrade amplify to v6...
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