Intro to Elixir (Building a GraphQL Api in Phoenix 1.3)
This tutorial starts a small mini-series of videos that will show users how to create a GraphQL api in Phoenix 1.3. With the introduction of contexts in phoenix 1.3, creating a strong API has become rather intuitive and simple. As mentioned in the last tutorial, we now have the ability to define data by category and context which gives us a great amount of encapsulation and also allows us to extend our data with purpose. Also, the context layer makes it much easier to interact with our repository/data layer.
GraphQL is a query language that was built by Facebook as an alternative to REST for building out APIs. It allows us to add meta-data and meta types to our data layer without having to add multiple different API queries to our application. It also allows user to query the data in our programs using a single request rather then a tree of requests. A GraphQL API endpoint can be built alongside of a RESTful API endpoint, but in our case, we will be building our API fully in GraphQL.
In this video, we focus on setup and adding read functionality to our API. A program/user can read the author list and the post list from our API fairly easily. In the next few tutorials, we will work towards building out the rest of the CRUD functions as well as adding User authentication and various other features to our application.
Full Github Source Code is here
If you enjoy the video, feel free to follow me on YouTube to get updates on the channel as well as more content for Rust, Elm, Elixir and Go.
Posted on Utopian.io - Rewarding Open Source Contributors