serverless / serverless/examples
Mutation was defined in resolvers, but it's not an object
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 4.4k
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 3
Description
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:
- clone the repo
- install deps
- follow steps for env variables in the README
npm run dev- visit graphql playground at
http://localhost:3000/dev/graphql - 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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the aws-node-typescript-apollo-lambda example, follow the README environment setup, run npm run dev, and reproduce the failure at http://localhost:3000/dev/graphql. Investigate the example's resolver configuration and determine what prevents the Mutation resolver from being treated as an object; done means the GraphQL Playground loads without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, graphql, node.js, typescript
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100