BlueChip – An ORM-like syntax for retrieving data from GraphQL or JsonAPI
github.com
github.com
/investors?select=name,investments(id,founders(name,address(city,country)))&investment.exit=gt.1000000.00
https://postgrest.orgThe problem is data transformation in an API. Quite often it's not as simple as just taking data out and putting data into a table. I suppose some of that could occur in SQL and some moved client side though. Would be pretty slick to eliminate the whole framework in between.
https://www.apollographql.com/docs/link/links/rest.html
https://www.apollographql.com/docs/link/links/state.html
The "apollo-link-rest" API makes it very easy to map, then query, your JSON APIs as a GraphQL service. So, no more mangling different query approaches for a client.
Then, simply add "apollo-link-state" to query/mutate local data using GraphQL as well.
This allows you to have 1 query/mutation language for both remote and local client state. This is much easier to deal with than adding yet another API to access your data.
Another positive is that you just might find yourself with the ability remove some redux boilerplate too as your local state can now be managed via Apollo's HOCs.
So, after writing this... What would be nice is to perhaps have the BlueChip API have an adapter layer that would allow it to read from something like the Apollo cache. This would allow for the implementation of resolvers on the client side to allow more fine grained control of the data being returned in a query (query parameter for filtering, cursoring and the like).
Abstracting the adapter layer is in the roadmap both for the specs (GraphQL, JsonAPI, nested or custom) and for the state managment (Redux, Mobx, Unstated, React setState, Pain JS Object, etc.)
[1] https://github.com/yury-dymov/json-api-normalizer
[2] https://github.com/yury-dymov/redux-object