Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Mutation was defined in resolvers, but it's not an object

Aperta
#553 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
aws, graphql, node.js, typescript
Ambito
api, backend, cloud

Direzione di ricerca

Clona l’esempio aws-node-typescript-apollo-lambda, segui la configurazione dell’ambiente nel README, esegui npm run dev e riproduci il fallimento all’indirizzo http://localhost:3000/dev/graphql. Analizza la configurazione dei resolver dell’esempio e determina cosa impedisce al resolver Mutation di essere trattato come un oggetto; il lavoro è completato quando GraphQL Playground viene caricato senza l’errore segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I've cloned the aws-node-typescript-apollo-lambda example and I cannot get the playground to work. I get the following error.

Error: Mutation was defined in resolvers, but it's not an object

To recreate the issue:

  1. clone the repo
  2. install deps
  3. follow steps for env variables in the README
  4. npm run dev
  5. visit graphql playground at http://localhost:3000/dev/graphql
  6. see console for error.

Here is the console output:

$ serverless offline --apiKey your-api-key-that-is-at-least-characters-long
Serverless: DOTENV: Loading environment variables from .env:
Serverless:      - APOLLO_LAMBDA_KEY
Serverless:      - NODE_ENV
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.
Serverless: Watching typescript files...
offline: Starting Offline: dev/us-east-1.
offline: Offline [http for lambda] listening on http://localhost:3002

   ┌───────────────────────────────────────────────────────────────────────────┐
   │                                                                           │
   │   POST | http://localhost:3000/dev/graphql                                │
   │   POST | http://localhost:3000/2015-03-31/functions/graphql/invocations   │
   │   GET  | http://localhost:3000/dev/graphql                                │
   │   POST | http://localhost:3000/2015-03-31/functions/graphql/invocations   │
   │                                                                           │
   └───────────────────────────────────────────────────────────────────────────┘

offline: [HTTP] server ready: http://localhost:3000 🚀
offline: 
offline: Enter "rp" to replay the last request
Serverless: Compiling with Typescript...
Serverless: Typescript compiled.

offline: GET /dev/graphql (λ: graphql)
offline: (λ: graphql) RequestId: ckf1whi0h0002gzxg0ks9b6c9  Duration: 251.31 ms  Billed Duration: 300 ms

offline: POST /dev/graphql (λ: graphql)
offline: Failure: Mutation was defined in resolvers, but it's not an object
Error: Mutation was defined in resolvers, but it's not an object
Lingua principale
JavaScript
Stelle
11.5k
Fork
4.4k
Merge medio
2h 55m
PR unite (30g)
3

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di serverless/examples

Tutte le issue di serverless/examples

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.