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.

requestDidStart hook not called if context creation failes

See original GitHub issue

If an error is thrown during context creation the requestDidStart hook is not called. As a result, using didEncounterErrors is not possible for those errors.

Note: formatError function is called

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
cbdtcommented, Sep 5, 2019

I have the same issue where the requestDidStart hook is not called, here’s the reproduction I made. It cause the code you provide here to not work because the plugin is never called. Hope it will help!

2reactions
victorcerqueiracommented, Dec 19, 2019

+1 I’m having the exact same issue as @cbdt. Please just let us know if we’re doing something wrong or if the hook is not working as intended.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo Server plugin event reference - Apollo GraphQL Docs
The contextCreationDidFail event fires if the user-provided context function throws an error. Because the request context is incomplete, this hook only receives ...
Read more >
How do I write a Apollo Server plugin to log the request and its ...
requestDidStart is called once per request and returns a map of request lifecycle hooks, so you can initialize any state persisted between ...
Read more >
React Login with Apollo Server, Context, JWT ... - YouTube
We use React Context, Apollo Client, Apollo Client Hooks, and more to create the full system overall! Want to support me?
Read more >
GraphQL: Apollo Server Plugins in Typescript - Jeff Magnusson
public requestDidStart(context: GraphQLRequestContext): GraphQLRequestListener | void { ... In this case, parsingDidStart is not called for the request, ...
Read more >
Apollo GraphQL Plugin All in One - E.Y. - Medium
Apollo Server fires two types of events that plugins can hook into: ... is starting to shut down when ApolloServer.stop() is invoked ....
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