[ERP-4356] GraphQL fixes#781
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a server crash on the patient listing page in MND dev, caused by patients with no working groups. The issue arose when working groups were deleted, leaving patients orphaned. The PR addresses two related issues: incorrect GraphQL error construction and missing support for None values in facets.
Changes:
- Fixed GraphQL error construction by converting error list to string before passing to GraphQLResultError
- Added fallback label for facets when get_label_fn returns None to handle patients without working groups
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rdrf/report/schema.py | Adds fallback "(Unassigned)" label when facet label function returns None, preventing crashes for patients with no working groups |
| rdrf/rdrf/patients/query_data.py | Converts GraphQL error list to string before raising GraphQLResultError, fixing incorrect parameter type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ppettitau
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an issue with the patient listing page that was causing server crashes in mnd dev. The crash was being caused by
Patients with noworking_groups(not merelyUnallocated). Patients can't be created without working groups, but when aWorkingGroupis deleted,Patients can be left without any.Firstly, the graphql error was being constructed incorrectly by passing a list where a string is expected.
Secondly, a change was made to allow facets to support
Nonevalues.