Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API - Graphql - Simple query - code sample possibly in error #383

Closed
netaisllc opened this issue Oct 9, 2018 · 2 comments
Closed

API - Graphql - Simple query - code sample possibly in error #383

netaisllc opened this issue Oct 9, 2018 · 2 comments

Comments

@netaisllc
Copy link

using this code from the samples:

// Simple query
const allEvents = await API.graphql(graphqlOperation(ListEvents));

resulted in the following webpack abend[1]::

> amplify-js-app@1.0.0 build /Users/cssian/Projects/graphql/amplify-js-app
> webpack

Hash: a9eb109f3fa4ac5532a9
Version: webpack 4.20.2
Time: 82ms
Built at: 2018-10-09 15:44:50
         Asset      Size  Chunks             Chunk Names
main.bundle.js    29 KiB    main  [emitted]  main
    index.html  1.54 KiB          [emitted]
Entrypoint main = main.bundle.js
[./src/app.js] 302 bytes {main} [built] [failed] [1 error]

ERROR in ./src/app.js 9:21
Module parse failed: Can not use keyword 'await' outside an async function (9:21)
You may need an appropriate loader to handle this file type.
|
| // Simple query
> const allEvents = await API.graphql( graphqlOperation( ListEvents) );
| console.log( allEvents);

[1] 'abend' - abnormal end

@frankmuellr frankmuellr transferred this issue from aws-amplify/aws-amplify.github.io Jan 17, 2019
@frankmuellr frankmuellr added the amplify/js Issues tied to JS label Jan 17, 2019
@stale
Copy link

stale bot commented Jun 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jun 22, 2019

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants