Facebook announced Relay and GraphQL. However, they are not available yet. Are there alternative libraries that accomplish similar goals that can be used today?
Making a GraphQL server compatible with Relay will assure that we have a well-structured, performant, and scalable GraphQL API that can be easily scalable to millions.
Well, the two major libraries for adding GraphQL to your React app are Relay and Apollo. Both are mature solutions, and plenty of people will swear by one or the other. But which one is right for you? I can’t answer that question for you. What I can do is show you what each looks like—by solving the same problem with both.
The two core assumptions that Relay makes about a GraphQL server are that it provides: A mechanism for refetching an object. A description of how to page through connections. This example demonstrates all two of these assumptions.
The schema described below will be used to demonstrate the functionality that a GraphQL server used by Relay should implement. The two core types are a faction and a ship in the Star Wars universe, where a faction has many ships associated with it.
There will be Falcor soon, but it also is not available yet.
Also there is some libraries like Breeze.js and JayData, which requires server to implement OData protocol.
UPD:
Falcor was released at August 17, 2015. Here is the official website. Here is the source codes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With