Intro to Elixir (GraphQL mutations and CRUD)

in #utopian-io7 years ago (edited)

GraphQL is truly the REST of the future. In this tutorial, we build out some of our mutation functionality and add CRUD functionality to the post schema of our application. We also look at setting up password encryption and decryption as well as Token and Session handling in Phoenix for User Authentication via the GraphQL Endpoint.

GraphQL features two different types of operations; Mutations and Queries. In the last post, we look at just Queries, but in this post we add Mutations to our endpoint. These mutations allow us to change the underlying data system in our program. This gives us the ability to read, update, create, and delete data from our system via requests. These mutation requests can also be used to do more complicated tasks such as passing login tokens and session ids to the user.

Phoenix 1.3's context model really helps us out in many of these instances. Rather then having to write and rewrite many different similar functions for the same functionality, we can easily use the boilerplate functions that were created for us when we ran our generators to access our data without getting our hands too dirty. This type of programming works really well in a GraphQL API Endpoint and also is suited for average RESTful APIs as well.

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

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you for your hard work as always.

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • You are generating more rewards than average for this category. Super!;)
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 64911.06
ETH 3194.94
USDT 1.00
SBD 2.60