API no configured
See original GitHub issueI keep getting “Api no configured” when calling the API.
src/aws-exports.js looks like this: `
const awsmobile = {
"aws_project_region": "eu-west-1",
"aws_appsync_graphqlEndpoint": "https://***.appsync-api.eu-west-1.amazonaws.com/graphql",
"aws_appsync_region": "eu-west-1",
"aws_appsync_authenticationType": "API_KEY",
"aws_appsync_apiKey": "da2-***"
};
export default awsmobile;
I’ve tried setting it up manually. Same results.
in App.js
import Amplify, { API, graphqlOperation } from 'aws-amplify';
import awsmobile from './aws-exports';
Amplify.Logger.LOG_LEVEL = 'DEBUG';
Amplify.configure(awsmobile);
const call = async () => {
const getAll = `query getAll{
listPrograms{
items {
id, name, description
}
}
}`;
const query = graphqlOperation(getAll);
const data = await API.graphql(query);
console.log(data);
};`
```
```
"aws-amplify": "^1.0.8",
"aws-amplify-react": "^1.0.6",
"aws-appsync": "^1.3.4",
```
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
API (REST) - Getting started - Swift - AWS Amplify Docs
To setup and configure your application with Amplify API to make requests to your API Gateway ... `No` ? Do you want to...
Read more >Amazon API Gateway quotas and important notes
API Gateway quotas for configuring and running a REST API ; Private APIs per account per Region, 600, No ; Length, in characters,...
Read more >Add GraphQL API - Web Analytics with Amplify
Do you want to configure advanced settings for the GraphQL API No, I am done. ? Do you have an annotated GraphQL schema?...
Read more >Uncaught (in promise) API <api_name> does not exist
configure (aws_exports) . For some reason aws exports was not getting initialized in index.js file so I moved it closer to where I...
Read more >amplify-js
+ import { Amplify, Auth } from 'aws-amplify'; + Amplify.configure(. ... that are not supported by Amplify, since aws-sdk-js-v3 is imported modularly.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve got it to work when i tried using modular imports. So this works, as opposed to the examples in the doc.
Yeah, it works also in Angular 7+ using the
API.configure(amplify)
. A bit confusing because the docs tell you to useAmplify.configure(amplify);
which I would assume would configure any child app under Amplify?