04/27/2018, 6:11 PM
Is the
syntax standard GraphQL syntactic sugar or a specific extension by graph.cool? See: https://www.howtographql.com/react-relay/7-subscriptions/ and scroll down or search for
_votesMeta { count }


04/27/2018, 8:53 PM
That's a great question, thanks for bringing this up @virtualirfan. I'd like to share some background information on this. _meta queries is a Graphcool specific approach for the Simple API. The idea of the Simple API was to reduce complexity of Relay compliant APIs (like the Graphcool Relay API). Two big complexities were the viewer pattern and the Relay connections. Relay connections come with an unwieldy edges/node construct. Back then, that was the status quo for GraphQL APIs: Imagine everyone getting started with GraphQL being super confused about this aspect for months and thinking this clumsiness is innate to GraphQL. That was a huge problem for the GraphQL community, and the "conventional wisdom" that Relay isn't well documented didn't help with this. In contrast, the queries in the Simple API reduce the two additional layers, tremendously improving the typical developer experience and making queries more approachable. Therefore the very creative name Simple API... 🙂 However, if you dig into it, Relay connections are really super elegant and beautiful. For example, you can run aggregation queries very naturally on the edge part of Relay connections. On the other hand, _meta queries are unwieldy in the Simple API. There are no edges that you can use for aggregations, so the next best thing is a meta query. Anyway, this all being said, this observation is what lead to combining Simple API style queries and Relay connection style queries into a single API in Prisma. This way, you get a consistent API while having the choice between using the simpler queries (in most cases) and the advanced queries when you need them. Hope that is some interesting food for thought 😊
👏 3


04/27/2018, 10:02 PM
That's a great response and lots of awesome context which I didn't have and appreciate. Yes, Relay documentation is pretty much non-existent. It really didn't help that the graph.cool playground didn't support a Relay mode and it took me way too long to figure out (accidentally) that I could just point directly to relay endpoint and play with it there to construct queries.
If this was ever useful and you guys were to take on-boarding new users to relay more seriously, I'd highly suggest the first time the playground is opened to auto-generate query based on the default User schema in the Relay style. Instant gratification and a more gentle ramp.
BTW: your description above deserves a blog post