3 ms·
Nothing explains the motivations for Relay/GraphQL better than their introduction of it earlier this year, I'd recommend watching the video: http://facebook.git
by alexobenauer 11y ago
Nothing explains the motivations for Relay/GraphQL better than their introduction of it earlier this year, I'd recommend watching the video: http://facebook.github.io/react/blog/2015/02/20/introducing-relay-and-graphql.html http://facebook.github.io/react/blog/2015/02/20/introducing-...
- pathsjs 11y agoIs there anything in text format? I really cannot follow the whole video right now. I tried to follow the slides, but they do not make much sense alone. Here are some examples of things I do not understand. The article below the video states that "By co-locating the queries with the view code, the developer can reason about what a component is doing by looking at it in isolation" but nowhere in the tutorial treasure hunt application I see this in action. There is a single React component called App, and I fail to see where it declares its data dependencies. Moreover, according to the article, "Each component specifies its own data dependencies declaratively", but it seems that a core concept is that of mutation, which does not sound very declarative (although I am not sure I understand what that is exactly). The code for the mutation seems to access the this.props (which I assume live on the component). This looks like a cyclic dependency between components and mutations. The mutation also access a query over something called CheckHidingSpotForTreasurePayload which seems to be defined only in schema.json, although - if I understand correctly - that json is auto-generated. All of this leaves me confused, which is why I was asking for a more conceptual explation. In other words: given the aims expressed in the article you linked (declarative data dependencies and so on), what is the reasoning that lead to the actual design of Relay?