question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API no configured

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
fadurcommented, Sep 5, 2018

I’ve got it to work when i tried using modular imports. So this works, as opposed to the examples in the doc.

import API, { graphqlOperation } from '@aws-amplify/api';
import awsmobile from './aws-exports';

API.configure(awsmobile);
4reactions
mattiLeBlanccommented, Jun 17, 2019

Yeah, it works also in Angular 7+ using the API.configure(amplify). A bit confusing because the docs tell you to use Amplify.configure(amplify); which I would assume would configure any child app under Amplify?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found