Closed ashwinikumar07 closed 1 month ago
Hi @ashwinikumar07 It looks like you have API Key as the default auth mode on your graphql client. Was the api key working before and only recently you started seeing this error?
This error, from what I recall, can occur if Amplify is trying to provide credentials to the request such as IAM signing or adding a logged in user's access token to the request headers. Is there a network request that is being sent out at all?
Lastly, could you share your schema so that we can try to identify any potential causes there?
The issue is resolved. The fix is that I have updated the aws-exports.js file as below:
const config = { aws_appsync_graphqlEndpoint: 'https://XXXXXXXXXXXX.appsync-api.us-east-1.amazonaws.com/graphql', aws_appsync_region: 'us-east-1', aws_appsync_authenticationType: 'API_KEY', aws_appsync_apiKey: 'da2-**', };
export default config;
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Version
Older than v5
Amplify Categories
api
Backend
CDK
Environment information
Describe the bug
I am using Api key as an auth to connect to appsync.
aws-amplify version 4.3.46 (I can't use the higher version above this due to some restriction)
Expected behavior
Graphql call should return the data successfully.
Reproduction steps
Install aws-amplify@4.3.46 Make the graphql query. (See the code Snippet) See the exception in console
Code Snippet
Log output
aws-exports.js
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const config = { API: { GraphQL: { endpoint: 'graphql_endpoint', region: 'us-east-1', defaultAuthMode: 'apiKey', apiKey: 'da2-***' } }, };
export default config;
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response