requestDidStart hook not called if context creation failes
See original GitHub issueIf 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:
- Created 4 years ago
- Reactions:10
- Comments:17 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
+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.