Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load .graphql files. how to add custom loader for graphq files? #1829

Open
deathemperor opened this issue Oct 23, 2024 · 0 comments

Comments

@deathemperor
Copy link

Bug Report

Before I use serverless-esbuild to config loader for .graphql files but with serverless v4 it doesn't work.

Current Behavior

Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
   * hello: my-service-dev-hello

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

Server ready: http://localhost:3000 🚀


GET /dev/hello (λ: hello)
✖ Unhandled exception in handler 'hello'.
✖ Runtime.UserCodeSyntaxError: SyntaxError: Unexpected identifier 'mutation_root'
    at _loadUserApp (/Users/deathemperor/papaya/slsv4-offline/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js:239:13)
    at async module.exports.load (/Users/deathemperor/papaya/slsv4-offline/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/aws-lambda-ric/UserFunction.js:311:19)
    at async InProcessRunner.run (file:///Users/deathemperor/papaya/slsv4-offline/node_modules/serverless-offline/src/lambda/handler-runner/in-process-runner/InProcessRunner.js:41:21)
    at async MessagePort.<anonymous> (file:///Users/deathemperor/papaya/slsv4-offline/node_modules/serverless-offline/src/lambda/handler-runner/worker-thread-runner/workerThreadHelper.js:24:14)
✖ SyntaxError: Unexpected identifier 'mutation_root'

Sample Code

https://github.com/papaya-insurtech/slsv4-offline

Expected behavior/code

Environment

  • serverless version: 4.4.7
  • serverless-offline version: 14.3.3
  • node.js version: v22.9.0
  • OS: macOS 15.1

Possible Solution

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant