1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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
답변함 2년 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전