question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug report: Cannot return null for non-nullable field on subscription_root

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
wawhalcommented, Nov 15, 2018

I could replicate this. Working on a fix.

1reaction
0x777commented, Nov 15, 2018

@wawhal Can we figure out if it is an issue with apollo and send a PR to them if that’s the case?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found