What you could also do is initialize 2 API clients, one with API_KEY as the default and one with AMAZON_COGNITO_USER_POOLS as the default, then use the public one in the public part of your app, and the private one in the private part of your app.
I'm not sure if this is possible using Amplify, but you could simply write your own wrapper!
Slightly less code, to not have to set 'authMode' for each API.graphql() invocation! This is very interesting. A single AppSync endpoint has a single default authorizer. A single Amplify GraphQL client instance may have a single default authorization mode. It's up to the developer to evolve this god for saken security model!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What you could also do is initialize 2 API clients, one with
API_KEY
as the default and one withAMAZON_COGNITO_USER_POOLS
as the default, then use the public one in the public part of your app, and the private one in the private part of your app.I'm not sure if this is possible using Amplify, but you could simply write your own wrapper!
Slightly less code, to not have to set 'authMode' for each API.graphql() invocation! This is very interesting. A single AppSync endpoint has a single default authorizer. A single Amplify GraphQL client instance may have a single default authorization mode. It's up to the developer to evolve this god for saken security model!