Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Graphql is returning the promise and not my DynamoDB data

I am using a Graphql API to access my DynamoDB database. I am then trying to render the list of users in my app. According to the docs I should use:

import * as queries from './graphql/queries';

const users = await API.graphql({ query: queries.listUsers });
console.log(users);

However, I get an error regarding the await. So I removed the await key word, but const users = API.graphql({ query: queries.listUsers }); returns the promise. This is the response:

Promise {
  "_U": 0,
  "_V": 0,
  "_W": null,
  "_X": null,
}

I put my code into an async function and used the await keyword and still only got the promise. Is there a way to simply call the query and without the await and get the correct data instead of the promise? I have also been trying to use the GraphQLResult to get the actual result, but that isn't working, I am either getting errors or I am still getting the promise.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

using try catch block to handle error of the await await return the promise result but after remove the await, it just return the promise, you should use then catch to get the result

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!