question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using with GraphQl (resolver)

See original GitHub issue

First of all many thanks for this great package 👍 Now I have a problem using this package with grapqhl (resolver). I always get the following output when a graphql error occurs:

{
  "errors": [
    {
      "message": "Cannot read property 'raw' of undefined",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "ArticleListAll"
      ],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "TypeError: Cannot read property 'raw' of undefined",
            "    at RenderFilter.<anonymous> (/home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/nest-next/dist/render.filter.js:36:33)",
            "    at Generator.next (<anonymous>)",
            "    at /home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/nest-next/dist/render.filter.js:16:71",
            "    at new Promise (<anonymous>)",
            "    at __awaiter (/home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/nest-next/dist/render.filter.js:12:12)",
            "    at RenderFilter.catch (/home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/nest-next/dist/render.filter.js:28:16)",
            "    at ExternalExceptionsHandler.invokeCustomFilters (/home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js:33:32)",
            "    at ExternalExceptionsHandler.next (/home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/@nestjs/core/exceptions/external-exceptions-handler.js:12:29)",
            "    at /home/rene/Projects/SmashoBase/nest/smasho-base/node_modules/@nestjs/core/helpers/external-proxy.js:12:42",
            "    at process._tickCallback (internal/process/next_tick.js:68:7)"
          ]
        }
      }
    }
  ],
  "data": {
    "ArticleListAll": null
  }
}

Also “setErrorHandler” is not triggered. A normal controller triggers it.

Thanks for your help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kyle-mccarthycommented, Mar 29, 2019

Yes, you are correct! I pushed v0.6.3 with this, sorry for prematurely closing the issue.

1reaction
kyle-mccarthycommented, Mar 28, 2019

Thank you for that example, it was extremely helpful. I just released v0.6.1 with a fix for your bug. Let me know if you have any other issues!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolvers - Apollo GraphQL Docs
A resolver is a function that's responsible for populating the data for a single field in your schema. It can populate that data...
Read more >
Execution - GraphQL
In fact, this is exactly how GraphQL works. Each field on each type is backed by a function called the resolver which is...
Read more >
GraphQL - Resolver - Tutorialspoint
GraphQL - Resolver, Resolver is a collection of functions that generate response for a GraphQL query. In simple terms, a resolver acts as...
Read more >
GraphQL Resolvers: Best Practices | by Mark Stuart - Medium
A resolver is a function that resolves a value for a type or field in a schema. Resolvers can return objects or scalars...
Read more >
How To Build GraphQL Resolvers for AWS Data Sources
A GraphQL resolver is a function or method that resolves a value for a type or field within a schema. A resolver is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found