November 2018
Beginner
502 pages
10h 22m
English
We are now going to use the Query component to get our GitHub name and avatar, replacing the axios code:
import gql from "graphql-tag";import { Query } from "react-apollo";
interface IQueryResult { viewer: IViewer;}
const GET_VIEWER = gql` { viewer { name avatarUrl } }`;
So, we set the query to a GET_VIEWER variable and we have defined our query in a template literal. However, the gql function just before the template literal is a little odd. Shouldn't ...
Read now
Unlock full access