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

Expose context function args in executeOperation #5026

Closed
wants to merge 1 commit into from

Conversation

bitglue
Copy link

@bitglue bitglue commented Mar 12, 2021

Fixes #2886

Integrations pass implementation-specific arguments to the context
function, but executeOperation passes no arguments. This allows the
caller of executeOperation to specify those arguments, either to emulate
the behavior of an integration or to achieve some other user-specific
behavior. This seems appropriate, as the context function is the
designated entry point for such user-specific behavior.

Fixes apollographql#2886

Integrations pass implementation-specific arguments to the context
function, but executeOperation passes no arguments. This allows the
caller of executeOperation to specify those arguments, either to emulate
the behavior of an integration or to achieve some other user-specific
behavior. This seems appropriate, as the context function is the
designated entry point for such user-specific behavior.
@apollo-cla
Copy link

@bitglue: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@bitglue
Copy link
Author

bitglue commented Mar 12, 2021

I'm pretty new to typescript, so sorry if this is a stupid question, but is there something I need to do to update the compiled javascript? I tried running npm compile, but that didn't change anything in dist/.

@glasser
Copy link
Member

glasser commented Mar 12, 2021

I asked some questions about this approach on #2886.

npm run compile should rebuild all the packages/*/dist. If it doesn't work, try npm run clean before it?

@glasser
Copy link
Member

glasser commented Mar 12, 2021

Er actually, run npm run clean and then npm install as the clean wipes out all the node_modules.

@glasser
Copy link
Member

glasser commented Mar 15, 2021

OK, this overall approach makes sense to me, though I might need to think more about the details. Adding this to my list for my next "focus on PRs which require at least a bit of thought" day.

@bitglue
Copy link
Author

bitglue commented Jul 13, 2021

We've solved this problem by using graphql-js directly rather than apollo. This PR doesn't seem to be going anywhere so closing to get it off my list.

@bitglue bitglue closed this Jul 13, 2021
@glasser
Copy link
Member

glasser commented Jul 13, 2021

@bitglue as you can see on the linked issue #2886, we fixed this in April with #4166, released in Apollo Server 2.23.0.

At some point in the process, I must have forgotten that there were two separate contributed PRs for the same fix and I never followed up here, sorry!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

executeOperation does not invoke context with expected arguments
3 participants