-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add context parameter to validationDidStart and parsingDidStart #1653
Conversation
@cliedeman: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
9b451a8
to
6be688f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small nit-picky request, but otherwise I think this looks good!
@@ -31,27 +31,46 @@ export interface GraphQLResponse { | |||
extensions?: object; | |||
} | |||
|
|||
export interface RequestDidStartOpts<TContext> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for breaking these interfaces out!
Can we be more explicit than *Opts
and just call these *Options
? Unless there's a pattern here that's being followed that I'm missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason. Updated
6be688f
to
02972f1
Compare
Thanks for opening this originally. We've done some pretty extensive overhaul to the request pipeline, and I believe that this should now be available in the lifecycle hooks for new request pipeline (#1795). We're working on updating the documentation to reflect this and I've changed a couple of the labels/milestones on this PR to reflect that. I'll leave this open for now, but I think you might find that this functionality is more easily accessible as of Apollo Server 2.2.0. |
Thanks for opening this originally. Following up on my previous comment, I'm going to close this PR as the If you haven't already tried using the new plugin hooks, I suggest taking a look at the documentation in #2008 (WIP!). We'll likely be deprecating the Let us know if you run into any problems with it! |
Added context to parsingDidStart and validationDidStart. Use case is that I collect tracing information in the context object and context is currently unavailable in these 2 hooks.
I also created interfaces for most of the hook methods so that writing graphql-extensions is easier instead of duplicating all the parameters.
TODO: