New development stack with GraphQL Prisma React Relay
1.GraphQL
In the modern application, microservice or monolith, REST API are the standard way of communication between front-end and back-end, between the difference services.
GraphQL, despite its name, it is not "Sequel to SQL?" or any database technology but rather a query language for API which address and solve multiple issues that REST API is missing or hardly implement with such as
- Over/under fetching data that lead to multiple rounds of request
- Endpoint hell, with the grow of an API service, more and more endpoints will be added in the project and it will become "spaghetti mess" ?!?
- API evolution is a well known REST standard but GraphQL help to make it easier to implement
However, GraphQL is a new version of REST API or better than REST, so yes they can be used in a same projects, they are powerful and easy to use when you use it right.
For more information about GraphQL: https://graphql.org/
2.React
React is a lightweight front-end "library" that helps to build web front-end by concept of break down thing into simple reusable components.
Calling React a library because it's only provide a render, state solution for front end not fully everything you will need like Angular. Therefore it's easier to set up and faster to learn but if you want to have more functions like routing, state management, caching then you will need to import 3rd party libraries.
Learn React on: https://reactjs.org/
3.Relay
To bring together GraphQL and React, Relay is the glue that stick this two technologies together as those three are come from the same company, Facebook.
Relay is basically a front-end framework providing networking layer that optimise the fetching data using GraphQL API. Relay will stick on the front-end together with React component to build a independent component with data binding to GraphQL API then optimise the request by compose all the data binding into one API call.
Relay official homepage: https://facebook.github.io/relay/
#graphql #react #relay