January 2019
Intermediate to advanced
460 pages
10h 33m
English
The registration form is nothing special. We follow the same steps as we took with the login form. You can clone the LoginMutation component, replace the request at the top with the signup mutation, and hand over the signup method to the underlying children. At the top, import all the dependencies and then parse the new query:
import React, { Component } from 'react';import { Mutation } from 'react-apollo';import gql from 'graphql-tag';const SIGNUP = gql` mutation signup($email : String!, $password : String!, $username : String!) { signup(email : $email, password : $password, username : $username) { token }}`;
As you can see, the username field is new here, which we send with every signup request. The component itself ...
Read now
Unlock full access