You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GraphQL Query results in Internal Server Error for Nullable Fields #778
Describe the bug
When querying the GraphQL API for Interfaces (this problem likely exists for other models), if you query for a field that doesn't exist in the config.xml but does exist in the Object's model and schema and it is a nullable field it throws an Internal Server Error for that object.
To Reproduce
Steps to reproduce the behavior:
Here is the simplest way to recreate the issue based on my environment:
Have or create at least two Interfaces in the UI, ensure that one is using DHCP and the other is a Static IP (I'm using IPv4 here but IPv6 will also likely work as well)
Perform this GraphQL Query:
{
queryInterfaces {
id,
descr,
ipaddr,
subnet
}
}
You'll notice the DHCP interface causes an Internal server error and is null in the output but the Static IP interface will return the expected values.
Expected behavior
When you query for a field in an object that is nullable and it doesn't exist on the specific object it should return null for that field instead of throwing the error.
Screenshots or Response
If applicable, add screenshots or response data to help explain your problem.
I can reproduce this and see where the issue is. Fields that are conditionally required are being always being marked as required fields when the GraphQL schema is generated. In this case, subnet is only required when typev4 is static but the schema is always expecting it to be present. I'll get a patch out with the fix for this.
Activity
jaredhendrickson13 commentedon Nov 9, 2025
I can reproduce this and see where the issue is. Fields that are conditionally required are being always being marked as required fields when the GraphQL schema is generated. In this case,
subnetis only required whentypev4isstaticbut the schema is always expecting it to be present. I'll get a patch out with the fix for this.Thanks for reporting!
fix(GraphQL): only mark types as nonNull if they are unconditional #778
test(GraphQL): ensure conditionally required fields can always be que…
Merge pull request #780 from jaredhendrickson13/next_patch