BREAKING CHANGES: Converted to use Redux stores. Login now working using Redux.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { onError } from "apollo-link-error";
|
||||
import { Observable } from "apollo-link";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { gql } from "apollo-boost";
|
||||
import { GET_CURRENT_USER } from "./local.queries";
|
||||
|
||||
export const typeDefs = gql`
|
||||
extend type Mutation {
|
||||
SetCurrentUser(user: User!): User!
|
||||
}
|
||||
|
||||
extend type User {
|
||||
email: String!
|
||||
displayName: String!
|
||||
token: String!
|
||||
}
|
||||
|
||||
extend type Jobs {
|
||||
id: uuid!
|
||||
}
|
||||
`;
|
||||
|
||||
export const resolvers = {
|
||||
Mutation: {
|
||||
setCurrentUser: (_root, { user }, { cache }) => {
|
||||
cache.writeQuery({
|
||||
query: GET_CURRENT_USER,
|
||||
data: { currentUser: user }
|
||||
});
|
||||
|
||||
return user;
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user