amplify-js
amplify-js copied to clipboard
How to point amplify v2 at existing aws graphql?
Amplify CLI Version
12.12.5
Question
I want to point my amplify v2 at a SAM generated app sync graphql URL and for it to use that rather than generating it in the amplify cli black box.
How do I do that?
Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂
Hi @cookiejest, if you need to point your frontend graphql client to your own AppSync graphql endpoint, you just need to configure the Amplify client like so:
import { Amplify } from 'aws-amplify';
Amplify.configure({
...Amplify.getConfig(),
API: {
GraphQL: {
endpoint: 'https://my-appsync-endpoint.us-east-1.aws.com',
defaultAuthMode: 'userPool',
},
},
});
For more information on using existing AWS resources, this page may be helpful:
https://docs.amplify.aws/react/build-a-backend/add-aws-services/analytics/existing-resources/#configuring-client-library-directly
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue.
Thank you!