Bug report: Cannot return null for non-nullable field on subscription_root
See original GitHub issueI’m using graphql-yoga
and use transformSchema
to rename root query for a remote schema.
The query works fine. But for subscription, i got the error : Cannot return null for non-nullable field on subscription_root.table_name
The function to rename is
function renameSchema(remoteExecSchema, prefix) {
return transformSchema(
remoteExecSchema,
[
new RenameTypes((type) => `${prefix}_${type}`),
new RenameRootFields((operation, name) => `${prefix}_${name}`)
]
);
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
schema transform bug: cannot return null for non nullable type ...
The error message reads "Cannot return null for non-nullable field subscription_root.user". Some details: Subscription root of the remote ...
Read more >Cannot return null for non-nullable field Subscription.counter
After checking your subscription resolver i found out that you did not return an object with a key counter as defined in your...
Read more >Operational vulnerabilities fail to load: Cannot return null for ...
Summary Operational vulnerabilities are currently failing to load with this error from GraphQL: Cannot return null for non-nullable field ...
Read more >GraphQL specification
Fields returning the type String expect to encounter UTF‐8 string internal values. GraphQL servers may coerce non‐string raw values to String when reasonable ......
Read more >GraphQL Server Tutorial with Apollo Server and Express
It means that the username is a non-nullable field. ... The query returns the User type, which can be null because a user...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I could replicate this. Working on a fix.
@wawhal Can we figure out if it is an issue with apollo and send a PR to them if that’s the case?