Skip to content

Conversation

@groybal
Copy link
Contributor

@groybal groybal commented Dec 31, 2025

… for required fields

Checklist
  • commit message follows commit guidelines (see commitlint.config.mjs)
  • tests are included (unit and/or integration tests)
  • all tests are successful
  • documentation is changed or added (in /docs directory)
  • code passes linting checks (uv run ruff check)
  • code passes formatting checks (uv run ruff format)
  • code passes type checking (uv run ty check)
  • pre-commit hooks have been run successfully
  • database schema changes: migration files created and CHANGELOG.md updated
  • API changes: base (Python code) documentation in docs/
    and project README updated
  • configuration changes: relevant folder README updated
  • breaking changes: added to MIGRATION.md with upgrade instructions
    and CHANGELOG.md entry
Type of Change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality
    to not work as expected)
  • Documentation update
  • Infrastructure/deployment change
  • Performance improvement
  • Code refactoring
Description of Change
Related Issues

Closes #747

Testing
  • Manual testing performed
  • Automated tests added/updated
  • Integration testing completed
Project Area(s) Affected
  • bases/
  • components/
  • orchestrators/
  • frontends/
  • deployments/
  • CloudFormation/SAM templates
  • Database schema
  • API endpoints
  • Documentation
  • Testing
Additional Notes

@groybal groybal marked this pull request as ready for review December 31, 2025 20:23
@groybal groybal requested review from cbeach47 and Copilot December 31, 2025 20:23
Copy link

Copilot AI left a 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 id to identifier for 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.

bjagg and others added 2 commits January 19, 2026 17:03
…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>
Copy link
Contributor

@cbeach47 cbeach47 left a 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  ?

@bjagg
Copy link
Contributor

bjagg commented Jan 21, 2026

Closes #799
Closes #793

@bjagg bjagg requested a review from cbeach47 January 21, 2026 06:31
@cbeach47
Copy link
Contributor

Discussed with @bjagg . Next steps for @bjagg :

  • Quick review on the rest of special characters in the data files
  • Fix the rest of the identifier casing
  • Run through the Test Plan for all users

Next steps for @cbeach47 :

  • No need for additional review on the script to adjust the data files.
  • The GraphQL entries for testing these changes are in the Lif-to-lif adapter code
  • Run through the Test Plan for all users

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

@cbeach47
Copy link
Contributor

@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

Copy link
Contributor

@cbeach47 cbeach47 left a 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). 💯

Copy link
Contributor

@cbeach47 cbeach47 left a 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
}
...

@bjagg
Copy link
Contributor

bjagg commented Jan 24, 2026

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Bug: Initial conversation with Advisor fails in GraphQL with 'Cannot return null for non-nullable field'

3 participants