You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think we should allow users to create empty fragments for instance in this case:
const graph = new Graph('Shop');
assert.deepEqual(splitQuery(graph.toQuery()), splitQuery('fragment on Shop { }'));
We should probably throw an Error when the user calls graph.toQuery(). Basically be pre-emptive on helping the user before they get errors back from the API.
The text was updated successfully, but these errors were encountered:
I've been thinking about this more and maybe the query should actually just return a blank string and log a warning that they're wanting to query Shop but are not selecting any fields.
I'm just thinking from a UI perspective. If a parent component sais something like:
"I am a Shop component therefore we'll need to query on Shop"
But then child UI components don't actually query any of the fields.
I think we should error out if they don't add selections to a field that has a kind of OBJECT. Any such query would fail, since all queries against an OBJECT kind require selections. I think I'd error at the point when addField is called and no selections are added.
I don't think we should allow users to create empty fragments for instance in this case:
We should probably throw an
Error
when the user callsgraph.toQuery()
. Basically be pre-emptive on helping the user before they get errors back from the API.The text was updated successfully, but these errors were encountered: