Skip to content

[ERP-4356] GraphQL fixes#781

Merged
Adam Smith (ScriptSmith) merged 2 commits into
next_releasefrom
ERP-4356-gql-fixes
Jan 27, 2026
Merged

[ERP-4356] GraphQL fixes#781
Adam Smith (ScriptSmith) merged 2 commits into
next_releasefrom
ERP-4356-gql-fixes

Conversation

@ScriptSmith

@ScriptSmith Adam Smith (ScriptSmith) commented Jan 27, 2026

Copy link
Copy Markdown
Member

Fixes an issue with the patient listing page that was causing server crashes in mnd dev. The crash was being caused by Patients with no working_groups (not merely Unallocated). Patients can't be created without working groups, but when a WorkingGroup is 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 None values.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread rdrf/report/schema.py
Comment thread rdrf/rdrf/patients/query_data.py
@ScriptSmith Adam Smith (ScriptSmith) marked this pull request as ready for review January 27, 2026 22:59
@ScriptSmith Adam Smith (ScriptSmith) merged commit 9c63937 into next_release Jan 27, 2026
14 checks passed
@ScriptSmith Adam Smith (ScriptSmith) deleted the ERP-4356-gql-fixes branch January 27, 2026 23:10
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.

3 participants