-
Notifications
You must be signed in to change notification settings - Fork 5
Issue #747: Fix issue with GraphQL failing due to getting null values… #753
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
base: main
Are you sure you want to change the base?
Conversation
7cc021a to
63fece6
Compare
…ng null values for required fields
63fece6 to
696b524
Compare
There was a problem hiding this comment.
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 issue #747 where GraphQL queries were failing with "Cannot return null for non-nullable field" errors. The issue occurred because certain required fields (informationSourceOrganization, identifier, and name) were missing from sample data and GraphQL queries.
Key changes:
- Updated GraphQL query to include missing required fields (
informationSourceOrganization,identifier,name) - Populated missing required fields in all sample JSON data files for org1 and org3
- Changed field references from
idtoidentifierfor consistency
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| graphql_query_all_fields_org3.graphql | Updated query to include informationSourceOrganization and name fields; changed refCourse.identifier from commented array structure to simple field |
| Renee-validated.json (org3) | Added missing informationSourceOrganization, name, and identifier fields; standardized id to identifier |
| Matt-validated.json (org3) | Added missing required fields to credential and course references |
| Jenna-validated.json (org3) | Added missing required fields to credential and course references |
| Alan-validated.json (org3) | Added missing required fields to credential and course references |
| Tracy-validated.json (org1) | Changed id to identifier throughout; added informationSourceOrganization and name fields |
| Sarah-validated.json (org1) | Changed id to identifier throughout; added informationSourceOrganization and name fields |
| Renee-validated.json (org1) | Changed id to identifier throughout; added informationSourceOrganization and name fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…per new LIF schema v2.0 - Add identifier and informationSourceOrganization to all entities - Update all 18 sample data files across advisor-demo-org1/2/3 and dev-single-org - Add fix_sample_data_schema.py script for automated schema migration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… entities - Add identifier and informationSourceOrganization to refPosition, assertedByRefOrganization, offeredByRefOrganization, approvedByRefOrganization, issuedByRefOrganization, and other nested refs - Update fix_sample_data_schema.py with additional entity mappings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cbeach47
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment - can you please review the large blocks of text changes for odd characters, such as U’ and  ?
projects/mongodb/sample_data/advisor-demo-org1/Matt-validated.json
Outdated
Show resolved
Hide resolved
projects/mongodb/sample_data/advisor-demo-org1/Sarah-validated.json
Outdated
Show resolved
Hide resolved
projects/mongodb/sample_data/advisor-demo-org2/Tracy-validated.json
Outdated
Show resolved
Hide resolved
|
Discussed with @bjagg . Next steps for @bjagg :
Next steps for @cbeach47 :
Eventually, the test plan should be converted into markdown format. For now, it's here: https://docs.google.com/spreadsheets/d/1P1rz-NSZGajREhc9mQJLeghzR9g5YaRATEaQGHrOKvc/edit?gid=0#gid=0 |
…ties/objects/arrays and camelCase for attributes
|
@bjagg Ran through the test plan. Results here: https://docs.google.com/spreadsheets/d/1P1rz-NSZGajREhc9mQJLeghzR9g5YaRATEaQGHrOKvc/edit?gid=0#gid=0 Overall things are good. Biggest issue was the Example REST API translations are not behaving and the Advisor only had access to Alan's data from that endpoint. Also, over several of the users, the Advisor couldn't name the orgs, and sometimes didn't get the categories right. I ran through some of the graphql/user queries directly. Bunch of data being returned, but some keys were associated with null values. Not sure if that is expected. Taking a look at the recent schema changes commit now |
cbeach47
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for removing the need for Docker when running pytest. Worked like a charm on my local (both with the tests being skipped and then being picked up after PG Server was installed / running). 💯
… new integration tests to track down issues to specific layers (i.e. mongodb, graphql)
cbeach47
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the direction of the integration tests. 💪
I may be misunderstanding, but I'm a bit concerned that we are continuing down the path (ie a fair bit of additional code / tests ) of loading sample data instead of having an endpoint return data that is then transformed by the MDR.
Ran through a few of the test plan scenarios, and some issues popped up:
https://docs.google.com/spreadsheets/d/1P1rz-NSZGajREhc9mQJLeghzR9g5YaRATEaQGHrOKvc/edit?gid=319322310#gid=319322310
Not sure if it's related, but the GraphQL endpoint is has some interesting data for the employee preference types:
query:
query GetPersonByIdentifier {
person(filter: {Identifier: {identifier: "100002", identifierType: "SCHOOL_ASSIGNED_NUMBER"}}) {
Name {
informationSourceId
lastName
firstName
}
Contact {
Email {
informationSourceId
emailAddress
}
}
Identifier {
informationSourceId
identifier
# identifierType
}
EmploymentLearningExperience {
informationSourceId
name
startDate
endDate
RefPosition {
name
informationSourceId
}
RefCredentialAward {
identifier
#awardIssueDate
#credentialAwardee
informationSourceId
informationSourceOrganization
name
}
}
PositionPreferences {
# informationSourceId
Travel {
percentage
willingToTravelIndicator
}
Relocation {
willingToRelocateIndicator
}
RemoteWork {
remoteWorkIndicator
}
positionTitles
positionOfferingTypeCodes
positionScheduleTypeCodes
#OfferedByRefRemunerationPackage {
# Ranges {
# MinimumAmount {
# value
# currency
# }
# }
# basisCode
#}
}
EmploymentPreferences {
# informationSourceId
# OfferedByRefOrganization {
# informationSourceId
# name
# identificationSystem
# organizationType
# }
identifier
organizationTypes
organizationNames
}
CredentialAward {
identifier
awardIssueDate
credentialAwardee
informationSourceId
}
}
}
Response:
...
{
"identifier": null,
"organizationTypes": [],
"organizationNames": [
"Corporate Partners",
"Technology Companies"
]
},
{
"identifier": null,
"organizationTypes": [
"Non-Profit"
],
"organizationNames": null
}
...
projects/mongodb/sample_data/advisor-demo-org2/Jenna-validated.json
Outdated
Show resolved
Hide resolved
projects/mongodb/sample_data/advisor-demo-org2/Tracy-validated.json
Outdated
Show resolved
Hide resolved
|
@cbeach47 the issue with the nulls is that required attributes (e.g. identifier) are missing from the test data. This is part of the schema change -- new required fields. Updating them as I come across them. |
… for required fields
Checklist
uv run ruff check)uv run ruff format)uv run ty check)docs/and project README updated
and CHANGELOG.md entry
Type of Change
to not work as expected)
Description of Change
Related Issues
Closes #747
Testing
Project Area(s) Affected
Additional Notes