Getting started with GraphQL in Rails

preview_player
Показать описание
Learn how to set up a GraphQL server using Rails and the graphql-ruby gem. We’ll create mutations for login and register and a query to fetch the currently authenticated user account.

Chapters:
0:00 Intro
0:27 Installing GraphQL
2:19 Generate GraphQL Types
3:29 Login mutation
6:13 Register mutation
8:18 Creating the auth token
11:42 Current logged in account query
13:25 Wrapping up

You'll find the docs for the graphql-ruby gem here:

All of the code for this tutorial is available on GitHub:
- If you want to follow along you’ll find the project at the beginning of the video on this branch:
- And the completed graphql example is here:

---

Has this video helped you out? Consider buying me a coffee to say thanks and support future content like this, thanks!

Рекомендации по теме
Комментарии
Автор

1:37 - What url did you enter to see "graphiql"? i already found it but as a general suggestion for the future use chrome so we can see your full url. This guide also does not work until i create a user model and specify a session store, if you run this on barebones rails api, graphicl doesnt even load.

kirka
Автор

9:20 Setting an attr_accessor for the token like that is not thread-safe. It might work in dev mode but in prod with potentially multiple app threads, it won't persist for every request. You should store that kind of token in the session. The session cookie is either encrypted data or a secure random id with session data in the db.

ehrenmurdick
Автор

please make a fully playlist for GraphQL with rails with apollo client

someshyadav
Автор

Thanks for this video.
You have good teaching skills.
That was awesome.

dencam
Автор

Do you think globalID can be used as part of an authentication system, or was it just an easy way to store and decode the data for the purposes of this demo?

exellin
Автор

and how can i filter ratings according to date range start date and end date as a params in graphql

someshyadav
Автор

Please, please, please, no background music. I'm sure the content was very good, but I had to find another YT video because the background music was so distracting.

JohnSmall