Skip to content

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Sep 12, 2025

Reintroduces tests from #5787. That PR adds error reporting when we nullify a field (due to it being invalid, or a required property of an object not having a value). Unfortunately, adding this reporting broke several customers in production, hence why it was reverted.

Without that error reporting, though, we are doing something clearly wrong. There is no way for a client to differentiate between a null value due to an error, or a null value that is intended. Testing the existing behaviour is step 0 towards resolving this long-standing defect.

This is a very early draft that just revives the testing from the old PR. Strategy here should be...:

  • Update these tests to expect the current behaviour (right now they expect improved behaviour)
  • Cover a lot more permutations of data types expected by the schema and data types returned by the subgraph

Then later, in separate PRs:

  • Add a (probably opt-in) configuration that reports errors correctly when we nullify a field. This would resolve the defect. It would be enabled by default in a future major version.
  • Add further validation/coercion of responses, for example for values with type ID, also opt-in behind a config flag.

Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@apollo-librarian
Copy link

apollo-librarian bot commented Sep 12, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: b304ef42014193e4ae7b6849
Build Logs: View logs

Copy link
Contributor

@goto-bus-stop, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

}

#[derive(Default)]
#[must_use = "Must call .test() to run the test"]
Copy link
Contributor

@TylerBloom TylerBloom Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note (mostly for myself) is to have an impl Drop there you panic for an even stronger enforcement of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants