Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda