relay: "Could not find a type name for record"

I’m experimenting with Relay and Graphql and I’ve got an error message on the browser console:

Warning: RelayQueryWriter: Could not find a type name for record UHJvZHVjdDpwXzE=.

Here is a runnable example of the issue: https://github.com/brenoc/relay-starter-kit/tree/relay/typenameIssue

This error disappears when I add __typename to the query here: https://github.com/brenoc/relay-starter-kit/blob/relay/typenameIssue/js/components/App.js#L20

What am I doing wrong?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 29 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Awesome, glad I could have been of help. Thanks for fixing it!

#860 fixed the warning for me. 👍

Thanks again for all the info - I think I see what’s happening. In both cases, Relay isn’t querying for __typename because the type is already known (for @laurenskling the type is User, for @gauravtiwari it’s Viewer). We can squash this warning by using the existing information about the type in the store, i’ll send a PR.

Note that in the meantime this is just a warning and Relay should be working just fine.