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

Gateway: pass through errors encountered when running final execute #4523

Closed

Conversation

princed
Copy link

@princed princed commented Sep 1, 2020

Fixes a problem where @apollo/gateway hides errors encountered when running final execute() from graphql-js, which can potentially both throw (e.g. from here) and return errors array in following cases:

@apollo-cla
Copy link

@princed: 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/

@abernix
Copy link
Member

abernix commented Sep 16, 2020

Hi @princed!,

This is a semi-automated message. Apologies for the lack of personal detail. I’d encourage reading the rest of this message but, if you're busy, hopefully this is as easy for you — or someone who is willing to own the contribution — as pushing the button later in this message to re-create this PR, from an auto-migrated branch, on the new Federation repository. If you have time, read on!

We’re in the process of moving federation-related concerns out of this repository (where it has historically lived) into a new home specifically for Apollo Federation. This PR is affected by the transition since it touches code which has been moved.

I’ve done some preparations to make this as easy as possible, but we’ll need to close this PR, and I could use your help in re-opening it on the new Apollo Federation repository.

In apollographql/federation#134 (which has a lot more details, if you’re interested), we introduced the same code that was in this repository to the new Federation repository (maintaining its history) and removed the code from this repository in #4561.

While this PR still needs to get reviewed and approved to land, it should no longer live in this repository in its current state since it cannot merge in anymore. To facilitate the movement of this PR to the new home, I’ve automatically generated branches on the new repository using the same commit authorship and messages that you originally included on this PR.

Pull-requests can’t be moved on GitHub in the same way Issues can be. While I could just create the PRs from these new branches too, the contribution belongs to you!


Original PR author only: Click this button to open a new PR from the auto-created apollo-server-import/pr-4523 branch on the new Apollo Federation repository

Original PR author: Click here to re-create this PR on the Federation repository

(You will have an opportunity to confirm, and this way you can continue to be the author and track its progress on the new Federation repository!)


There’s no easy way to bring over any existing comments on this PR, so I encourage you to copy and paste those onto the new issue if possible.

Overall, I hope this process is relatively easy for you while maintaining your commit contribution authorship. I apologize for any inconvenience caused by this shuffle, but please ping me if I can help in any way!

🚀

@princed
Copy link
Author

princed commented Sep 16, 2020

Thank you @abernix, this the best migration I've ever seen!

@princed princed deleted the gateway-expose-execute-errors branch September 16, 2020 13:17
@abernix
Copy link
Member

abernix commented Sep 16, 2020

Thanks for being the first to test it. 😉 Hoping we can get your PR reviewed on the other side!

@princed
Copy link
Author

princed commented Sep 16, 2020

Thanks! Looking forward to hearing from reviewers 😄

abernix added a commit to apollographql/federation that referenced this pull request Aug 26, 2021
…xecute (#159)"

This reverts commit 9045f55, which was from
#159.

See the comment in #981
which explains the justification as well, but briefly:

While that PR was an improvement in principle, it:

- has a bug that was first captured in
  #159 (comment)
To quote that here:

  > I think there's a bug here. Let's say we have a query `{ x }` where `x`
is a non-nullable field, and the federated execution has `x` throw an error.
This turns all of `data` into `null` (not `{ x: null }`). But then this
re-execution adds another error saying that the non-null field is null.
  >
  > Take a look at
https://codesandbox.io/s/angry-raman-uuzuf?file=/src/index.js for an example
of what's going on here.

- Sometimes — unexpectedly to current users, at least — breaks client
  expectations.

As of now, the pain points seem to be outweighing the gains.  We'll need to
revert this and revisit this when time allows with a slightly different
approach and #981 tracks
the need to do so.

Ref: #159
Ref: apollographql/apollo-server#5550
Ref: #974
Ref: apollographql/apollo-server#4523
abernix added a commit to apollographql/federation that referenced this pull request Aug 26, 2021
…xecute (#159)" (#982)

This reverts commit 9045f55, which was from
#159.

See the comment in #981
which explains the justification as well, but briefly:

While that PR was an improvement in principle, it:

- has a bug that was first captured in
  #159 (comment)
To quote that here:

  > I think there's a bug here. Let's say we have a query `{ x }` where `x`
is a non-nullable field, and the federated execution has `x` throw an error.
This turns all of `data` into `null` (not `{ x: null }`). But then this
re-execution adds another error saying that the non-null field is null.
  >
  > Take a look at
https://codesandbox.io/s/angry-raman-uuzuf?file=/src/index.js for an example
of what's going on here.

- Sometimes — unexpectedly to current users, at least — breaks client
  expectations.

As of now, the pain points seem to be outweighing the gains.  We'll need to
revert this and revisit this when time allows with a slightly different
approach and #981 tracks
the need to do so.

Ref: #159
Ref: apollographql/apollo-server#5550
Ref: #974
Ref: apollographql/apollo-server#4523
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 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.

3 participants