News for hackers. Stuff that matters.
Re:React, Relay and GraphQL: Under the Hood of the Times Web... by thomasfoster96 on Saturday July 01, 2017 @12:20PM (#14677711)
I strongly suggest that you look at Apollo's GraphQL offerings. My 'aha' moment with GraphQL came while reading the docs for their GraphQL server[0].

IMHO Relay doesn't make a lot of sense. Apollo Client [1] has a much better feature set for most use cases, doesn't need React and is better documented.

[0] http://dev.apollodata.com/tools/graphql-tools/resolvers.html [1] http://dev.apollodata.com/core/

Re:React, Relay and GraphQL: Under the Hood of the Times Web... by fishnchips on Saturday July 01, 2017 @01:49PM (#14678072)
+1 to that. I'm working on a (mostly) GraphQL application with a Rails backend and a React frontend with a touch of Redux. I really wanted to like Relay but the documentation was lacking (I suspect that a major API change is to blame) and the amount of boilerplate is prohibitive. On the other hand Apollo Client is straightforward, framework agnostic with great React bindings. As a web development veteran I feel that I've never been as productive as with this particular stack.
Re:React, Relay and GraphQL: Under the Hood of the Times Web... by andrewingram on Saturday July 01, 2017 @03:11PM (#14678470)
Used Relay Classic for a year and a half, been using Relay Modern for a month or so. You are absolutely right, the documentation situation is terrible. The fact that the new mutation API has practically zero documentation is troubling.

I've been sticking with it though, and I am enjoying it. I feel like I have a greater grasp of what's going to be executed and when than I ever did with Relay Classic, and the file size + performance improvements are worth the cost of admission in my mind.

Re:React, Relay and GraphQL: Under the Hood of the Times Web... by thomasfoster96 on Saturday July 01, 2017 @08:29PM (#14679989)
Have you been using normal Relay or one of the forks/modified versions that supports server-side rendering? The fact that Apollo Client supports server-side rendering out of the box was a big plus for me.

> the file size + performance improvements are worth the cost of admission in my mind.

Is this Relay Classic vs Relay Modern or Relay vs Apollo?

Re:React, Relay and GraphQL: Under the Hood of the Times Web... by andrewingram on Sunday July 02, 2017 @08:03AM (#14682126)
The libraries that support server-side rendering aren't forks, they sit alongside Relay. But yes i've been using them for well over a year without any issues. I haven't tried it with Relay Modern yet, but there are examples out there of how to do it.

Relay Modern is 20% of the size (or 5 times smaller) than Relay Classic, which (if my calculations are correct, I don't have equivalent environments set up) is just over half the size of React Apollo + Apollo Client.