Using a Relay Container and Github's GraphQL API if I have fragment on User { id }
it successfully loads my github account id . However if I try fragment on Repository {}
it says "GraphQL unknown type".
What is the best way to reliably query fragments from GitHub's API using Relay?
I was getting the error because graphQL has specific properties accessible to the client. Trying to fetch an erroneous fragment (or in my case incorrectly nested fragment names) results in "GraphQL unknown type". The solution is to use Github's GraphQL root node called
relay
which re-exposes all root queries such asrepository
see the docs for more details. Here is my parent query:and here is my container component