Mixed authentication (public/private) with a many-to-many schema fails #6104
Labels
bug
Something isn't working
@connection
Issues tied to @connection directive
graphql-transformer-v1
Issue related to GraphQL Transformer v1
Projects
Describe the bug
When creating a simple many-to-many schema, it appears that the compiled graphql schema does not include the appropriate permission attributes necessary for handling an API that supports both public and private use.
Given a many to many relationship using only Cognito auth modes, everything works as expected, but the minute you introduce:
Into the model, it appears that the linking model is not decorated in the final output with any authorization attributes, causing it to throw errors for both authenticated as well as unauthenticated users.
Amplify CLI Version
4.37.0
To Reproduce
amplify add api
amplify api gql-compile
ModelPostLikeConnection
does not have any auth attributesWhen querying the
Post
model and trying to also pull in alluserLikes
the query will fail with a message ofNot Authorized to access nextToken on type ModelPostLikeConnection
Expected behavior
The linking table should look like this:
Desktop (please complete the following information):
Additional context
A minimal repo with the graphql schema necessary to reproduce the bug can be found here: https://github.com/josh-tncarry/many-to-many-amplify-bug
The text was updated successfully, but these errors were encountered: