Skip to content

Commit 115b57e

Browse files
authored
Merge pull request #65 from snek-at/improve-errorhandling-aa1
Improve errorhandling aa1 to implement 2
2 parents 628d8f6 + 733a509 commit 115b57e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/session/sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ class SnekSession extends CookieSession {
294294
async customTask<T>(type: string, data: DocumentNode, variables: object) {
295295
return this.tasks.run<T>(type, data, {
296296
...variables,
297-
token: this.token,
297+
token: await this.upToDateToken(),
298298
refreshToken: this.refreshToken,
299299
});
300300
}

src/templates/snek/gql/tasks/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class SnekTasks extends TaskError {
5050
this.user = new SnekGqlUserTasks(this);
5151
}
5252

53-
async run<T>(type: string, query: DocumentNode, variables: object) {
53+
async run<T>(
54+
type: string,
55+
query: DocumentNode,
56+
variables: object
57+
): Promise<ApolloResult<T>> {
5458
let response: ApolloResult<T>;
5559

5660
if (type === "query") {

0 commit comments

Comments
 (0)