Skip to content

Commit

Permalink
improve session
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslopezj committed Dec 9, 2020
1 parent b0bd044 commit be7522e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/graphql-client/src/auth/setSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import {getOptions} from '../options'
export default async function (session, resetStore = true) {
const {apolloClient, saveSession, wsClient} = getOptions()

if (resetStore) {
await apolloClient.clearStore()
}

await saveSession(session)

if (resetStore) {
await apolloClient.resetStore()
await apolloClient.reFetchObservableQueries()
}

if (wsClient) {
Expand Down

0 comments on commit be7522e

Please sign in to comment.