GraphQL query fails completely when VMs or Docker are unavailable instead of returning partial data
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 22
- Avg merge
- 10h 40m
- Merged PRs (30d)
- 13
Description
Environment
Unraid OS Version:
7.2.2
Are you using a reverse proxy?
No. Tested by accessing the server directly via local IP.
Pre-submission Checklist
- I have verified that my Unraid OS is up to date
- I have tested this issue by accessing my server directly (not through a reverse proxy)
- This is not an Unraid Connect related issue (if it is, please submit via the support form instead)
Issue Description
When querying the GraphQL API with a query that includes vms and/or docker fields, if these services are not available on the server, the entire query fails instead of returning partial data with null values for the unavailable fields.
This breaks the standard GraphQL behavior as defined in the GraphQL specification, where partial data should be returned alongside errors.
Steps to Reproduce
- Have an Unraid server without VMs configured/available
- Open the GraphQL playground at
http://[SERVER_IP]/graphql - Execute the following query:
query DashboardQuery {
info {
time
os {
hostname
uptime
}
}
vms {
id
domain {
id
name
state
}
}
}
Expected Behavior
According to GraphQL specification, when a resolver fails, the field should be set to null and the error should be added to the errors array, but other fields should still be resolved:
{
"data": {
"info": {
"time": "...",
"os": {
"hostname": "tower",
"uptime": "..."
}
},
"vms": null
},
"errors": [
{
"message": "Failed to retrieve VM domains: VMs are not available",
"path": ["vms"]
}
]
}
Actual Behavior
The query returns an error with data: null, losing all other valid data:
{
"data": null,
"errors": [
{
"message": "Failed to retrieve VM domains: VMs are not available"
}
]
}
Additional Context
This behavior prevents client applications from displaying basic server information (CPU, memory, array status, etc.) when VMs or Docker services are not available.
Workaround: Removing vms and docker fields from the query returns data correctly, but this requires clients to know in advance which services are available, defeating the purpose of a unified dashboard query.
Same query without vms/docker works fine:
query DashboardQuery {
info {
time
os { hostname uptime }
}
array {
state
}
}
This suggests the issue is in the error handling of the vms and docker resolvers, which should catch errors and return null instead of propagating the error to the entire response.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the GraphQL playground with the provided DashboardQuery on a server where VMs or Docker are unavailable. Start by tracing the vms and docker resolvers and their error handling. Done means unavailable fields produce null values with errors while available fields such as info still appear in the response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100