-
Notifications
You must be signed in to change notification settings - Fork 2
[API] Amplify API Library를 이용하여 외부 GraphQL API(non AppSync) 와 통신
TaeSeong Park edited this page Jun 17, 2020
·
3 revisions
Medium: AWS Amplify API Library로 외부 graphql API 호출 해 보기
Amplify Docs에 대표적으로 소개되고 있는 방법이다
- Amplify Docs: Using AWS AppSync SDK
- YouTube: How to deploy an Apollo GraphQL server running in AWS Lambda with Amplify Functions
import AWSAppSyncClient, { AUTH_TYPE } from 'aws-appsync';
import awsconfig from './aws-exports';
const client = new AWSAppSyncClient({
url: awsconfig.aws_appsync_graphqlEndpoint,
region: awsconfig.aws_appsync_region,
auth: {
type: AUTH_TYPE.API_KEY,
apiKey: awsconfig.aws_appsync_apiKey,
},
});
- Amplify Docs: Set Custom Request Headers for non-AppSync GraphQL APIs
- Medium: Introducing the AWS Amplify GraphQL Client
Amplify.configure({
API: {
graphql_endpoint: 'https:/www.example.com/my-graphql-endpoint',
graphql_headers: async () => ({
'My-Custom-Header': 'my value'
})
}
});