1 Answer
- Newest
- Most votes
- Most comments
0
Eventually got it working
import Amplify, {Auth, API } from 'aws-amplify';
import {GraphQLResult} from '@aws-amplify/api-graphql';
...
Amplify.configure({
aws_appsync_graphqlEndpoint: process.env.GRAPHQLURL,
Auth: {
region: process.env.AWS_DEFAULT_REGION,
identityPoolRegion: process.env.AWS_DEFAULT_REGION,
userPoolId: process.env.USERPOOLID,
userPoolWebClientId: process.env.CLIENTID,
Credentials: {
authenticationFlowType: 'USER_PASSWORD_AUTH',
}
}
});
...
const token = await Auth.signIn( process.env.USERID || '', process.env.APPSYNCPWD);
...
const response = (await API.graphql({ query , authMode: 'AMAZON_COGNITO_USER_POOLS', authToken: token} )) as GraphQLResult;
...
Looks more complicated than I would hope is needed, but for now I am going to stick with it
Suggestions to simplify more than welcome!
Tx
Peter
answered 2 years ago
Relevant content
- asked 2 years ago
- asked 9 months ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago