Closed diguini closed 2 years ago
I resolved by this solution here: https://github.com/aws-amplify/amplify-cli/issues/2715#issuecomment-553550734 changing my schema.graphql to:
type Subscription {
onStudentNotificationByStudentId(studentId: ID!): StudentNotification
@aws_subscribe(mutations: ["createStudentNotification"])
@aws_cognito_user_pools
}
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication, GraphQL API
Amplify Categories
auth, api
Environment information
Describe the bug
Trying to subscribe to a custom subscription throws the error :
Not Authorized to access onStudentNotificationByStudentId on type Subscription
, it's curiously because i able to subscribe to other models before trying this one. I'm logged with auth by cognito_user_pool as well.Expected behavior
Should be able to subscribe without error.
Reproduction steps
Call a custom subscription with a logged user.
Code Snippet
My schema.graphql:
My subscription query:
And my code:
// Put your logs below this line