These are chat archives for amelisa/amelisa

May 2016
Vladimir Makhaev
May 06 2016 05:18
@droganov I think the biggest advantage of using GraphQL with amelisa is ability to subscribe in React component for all needed data if it has complex relations. For example, if you have categoryId and want to show images of products of this category, with mongo queries you need to wrap your component into another component where you subscribe for products and then in underlying component subscribe for products images. With GraphQL you can create one query for this.
Another thing that can be useful is computed results. Like, fullname = firstname + lastname and so on.
What about differences with Relay. In Relay GraphQL queries fetches only data fields that contains in query. This is done for reducing traffic between server and client. Also Relay can have a kind of data caching. In Amelisa whole document with all metadata will be fetched even if you specified just one field. But for subsequent queries on this document nothing will be fetched, because it's already on client and up to date. These two approaches can have pros and cons in different use cases. Also in amelisa there are subscriptions for GraphQL queries and offline. There are discussions for adding subscriptions to Relay and I think it will be added sooner or later.
Right now GraphQL in amelisa is in proof of concept stage. I want to make Relay-like api or even integrate with Relay if it's possible.
May 06 2016 10:30

Actually we’re working on racer driver for GrapQL, so it’s interesting to look what is happening around :-). We’re going to utilise racer’s API and driver will make transforms and talk to GraphQL server. It already works with sertain limitations. I think later this year we’ll release the first product and test everything. But we don’t need the offline.

Relay can have subscriptions, but I didn’t see any mentions that they will be synchronised. Also Relay itself is so heavy... so it makes me sceptical about using it — load 1MB to save several KB on projections… I don’t get it :-)