Skip to content

Conversation

andrew-demb
Copy link
Contributor

In our case, we attempted to investigate the reason for the error "Unexpected null value for non nullable field" for the array output field (and all PHP types were returning an array). But the real reason was about array elements - we returned null instead of a string - aka array('foobar', null) instead of array('foobar') - because of array<string> phpdoc over the output field method.


Before:

In Acme\Graphql\Type\FooType::getButtons() (declaring field "buttons"): Unexpected null value for non nullable field.

After:

In Acme\Graphql\Type\FooType::getButtons() (declaring field "buttons"): Unexpected null value for non nullable field. Expected: "String!".

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.79%. Comparing base (53f9d49) to head (3becc34).
⚠️ Report is 124 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #762      +/-   ##
============================================
- Coverage     95.72%   94.79%   -0.94%     
- Complexity     1773     1846      +73     
============================================
  Files           154      175      +21     
  Lines          4586     5014     +428     
============================================
+ Hits           4390     4753     +363     
- Misses          196      261      +65     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrew-demb
Copy link
Contributor Author

CI failure is unrelated

With the provided path, there will be 282 files uploaded
Artifact name is valid!
Root directory input is valid!
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

@oojacoboo oojacoboo merged commit cb7c195 into thecodingmachine:master Oct 10, 2025
19 of 20 checks passed
@oojacoboo
Copy link
Collaborator

Thanks @andrew-demb

@andrew-demb andrew-demb deleted the improve-unexpected-null-exception branch October 10, 2025 18:59
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