Skip to content

Commit fc9afee

Browse files
committed
fix missing session headers for graphql requests
1 parent 124130e commit fc9afee

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/common/useApi.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let component_name_map = null;
1919

2020
const graphql_cache = new InMemoryCache();
2121
// @ts-ignore
22-
const oauth_link = new SetContextLink(async (_, { headers }) => {
22+
const oauth_link = new SetContextLink(async ({ headers }) => {
2323
const { getAuthToken, refreshAuthToken } = useAuth();
2424
await refreshAuthToken();
2525
return {
@@ -181,6 +181,11 @@ export function useApi() {
181181
query: gql`${query}`,
182182
fetchPolicy: fetchPolicy,
183183
errorPolicy: errorPolicy,
184+
context: {
185+
headers: {
186+
...getSessionHeaders()
187+
}
188+
}
184189
});
185190
};
186191

0 commit comments

Comments
 (0)