I'm using the latest official aws plugin and the flutter graphql plugin. I want to use AppSync. And in the graphql readme it describes how to do this.
To use with an AppSync GraphQL API that is authorized with AWS Cognito User Pools, simply pass the JWT token for your Cognito user session in to the AuthLink:
// Where `session` is a CognitorUserSession
// from amazon_cognito_identity_dart_2
final token = session.getAccessToken().getJwtToken();
final AuthLink authLink = AuthLink(
getToken: () => token,
);
My problem is from the aws plugin, There is a method called fetchAuthSession that returns a session with different tokens. But it doesn't return the jwtToken.. Are any of the returned tokens used for AppSync? Please click the session link for the different tokens...
accessTokensee below how to get it @AshootoshBhardwaj - flutter