yawp
yawp copied to clipboard
GraphQL Support
I'm thinking about adding GraphQL support. I'd like to hear some of your thoughts on it, feel free to criticize. The idea is to keep both the REST and GraphQL modes.
Our current REST model is also flexible in a way that it already supports a good subset of a GraphQL server.
We would need to export a /graphql
endpoint that routes to a Java GraphQL Schema. The schema could be created directly from the same way we declare models today with the help of some Java GraphQL library like: https://github.com/graphql-java/graphql-java
I think it's a very good ideal. GraphQL and Relay are a very nice way to fetch data from the server using a component driven front-end. Also it increases the readability of queries on the front-end, since JSON.
Started development on graphql
branch. Right now it creates a schema with a field at the root level for every endpoint; this field returns a list of that endpoint, and receives optional arguments for filtering, just like the /people
route would.
There is much more to do though, like: complex queries, security using shields, actions, transformer & hooks, et cetera.
I'm slowly working towards it :)
+1