In progress sign in changes.

This commit is contained in:
Patrick Fic
2019-12-04 21:02:23 -07:00
parent 25d434ef10
commit b2649a25cc
8 changed files with 203 additions and 23 deletions

View File

@@ -0,0 +1,36 @@
import React from "react";
import { Mutation, Query } from "react-apollo";
import { gql } from "apollo-boost";
import App from "./App";
const SET_CURRENT_USER = gql`
mutation SetCurrentUser($user: User!) {
setCurrentUser(user: $user) @client
}
`;
const GET_CURRENT_USER = gql`
{
currentUser @client
}
`;
const AppContainer = () => (
<Query query={GET_CURRENT_USER}>
{({ data: { currentUser } }) => (
<Mutation mutation={SET_CURRENT_USER}>
{setCurrentUser => (
<App
currentUser={currentUser}
setCurrentUser={user => {
setCurrentUser({ variables: { user } });
}}
/>
)}
</Mutation>
)}
</Query>
);
export default AppContainer;