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

227
Views
NHOST TypeError: (valor intermedio) no es una función

El siguiente código de NHOST (https://docs.nhost.io/get-started/quick-start/javascript-client ):

 import { NhostClient } from '@nhost/nhost-js' const nhost = new NhostClient({ backendUrl: 'https://[app-subdomain].nhost.run' })(async () => { // nhost.graphql.request returns a promise, so we use await here const todos = await nhost.graphql.request(` query { todos { id created_at name is_completed } } `) // Print todos to console console.log(JSON.stringify(todos.data, null, 2)) })()

me esta dando un error en la terminal:

 })(async () => { ^ TypeError: (intermediate value) is not a function at file:///Users/User/Documents/nhost-todos/index.js:5:3 at ModuleJob.run (node:internal/modules/esm/module_job:197:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:337:24) at async loadESM (node:internal/process/esm_loader:88:5) at async handleMainPromise (node:internal/modules/run_main:61:12)

Se supone que debe regresar:

 null

después de ejecutar el nodo index.js.

Cualquier ayuda sería muy apreciada. Todos estos son conceptos relativamente nuevos para mí.

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

0

Puedes hacerlo:

 import { NhostClient } from '@nhost/nhost-js'; const nhost = new NhostClient({ backendUrl: '', }); const request = async () => { // nhost.graphql.request returns a promise, so we use await here const todos = await nhost.graphql.request(` query { todos { id created_at name is_completed } } `); // Print todos to console console.log(JSON.stringify(todos.data, null, 2)); }; request();
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!