Learn how to turn our Relay mutations into promises for the purposes of authentication.
- [Instructor] In the last two videos,…we created our CreateUser and our Signin mutations.…Now we need to bring that in to our auth.js file,…which is here in the utils directory.…We need to add CreateUser and SigninUser mutations…to our auth flow.…We'll start by here on Line 4 importing CreateUser…from mutations/CreateUser.…
I'm going to copy and paste this…and change it for Signin.…We'll say SigninUser.…And SigninUser.…We'll now have these two mutations…available to us in our auth file.…We also need to make sure we bring in Relay.…I'm going to do that at the very top of the page on Line 2.…
You'll see we're getting some warnings in our console,…and that's because we're not making use of Relay…or CreateUser or SigninUser yet, but we'll get to that.…I know that we're going to want to…add these mutations to authProcess,…but before we can do that,…I want to turn them into promises.…What I mean by that is CreateUser and SigninUser…as they exist now will be asynchronous,…and they'll return a response…either when they succeed or fail.…
- Installing local dependencies
- Generating a starter project
- Deploying to Heroku
- Planning your development process
- Using styled-components
- Styling for mobile
- Setting up models on Graphcool
- Creating Relay mutations
- Adding Relay to your authentication flow
- Protecting routes with authentication
Skill Level Intermediate
React.js: Building an Interfacewith Ray Villalobos1h 21m Intermediate
2. Deployment Environments
3. App Functionality
4. Implementing Libraries
5. Creating Components
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.