You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script lang="ts">
import { ApolloClient, InMemoryCache } from "@apollo/client";
import { setClient } from "svelte-apollo";
export let token: string = "";
const cache = new InMemoryCache();
const client = new ApolloClient({
uri: import.meta.env.VITE_HASURA_GQL_URL,
cache,
headers: {
Authorization: `Bearer ${token}`,
},
});
setClient(client);
</script>
<slot />
Passing in an updated token via props does not cause a re-render. Since the whole basis of this library is passing the Client through Context, and Context only being able to be set during component initialization, I do not see how it is possible to update the Client after initialization, such as when a new token is provided through a refresh token operation.
Please advise.
The text was updated successfully, but these errors were encountered:
Passing in an updated token via props does not cause a re-render. Since the whole basis of this library is passing the Client through Context, and Context only being able to be set during component initialization, I do not see how it is possible to update the Client after initialization, such as when a new token is provided through a refresh token operation.
Please advise.
The text was updated successfully, but these errors were encountered: