- GraphQL is a data query language developed internally by Facebook in 2012 before being publicly released in 2015.
- It allows clients to define the structure of the data required, and exactly the same structure of the data is returned from the server.
- Major GraphQL clients include Apollo Client and Relay.
- On the 9th February 2018, the GraphQL Schema Definition Language (SDL) was made part of the specification.
- Graphically, this is the schema of a Redux app: – – Basically, Redux does the following: – – An OTP GenServer does the following: – – In short, we can use the same mental model for the client and server side.
- We can dispatch events to Elixir, compute a new version state server side, propagate this state to redux, and our views will get updated automatically.
- We have just implemented the thick red arrows: – – We will update the store with the state that comes from the server in two different situations.
- With this, we have connected the server state with Redux state.
- But, if you want to have state shared between different users, or we want to have pieces of the state in the server for other reasons, such as enforcing validation rules, we can use the same mental mode with Elixir GenServers.
Digital solutions partner. High quality work with Symfony, React and Elixir.
Continue reading “The joy of React+Redux with Elixir/OTP”