Skip to content

Commit

Permalink
Merge pull request #65 from snek-at/improve-errorhandling-aa1
Browse files Browse the repository at this point in the history
Improve errorhandling aa1 to implement 2
  • Loading branch information
schettn authored Aug 24, 2020
2 parents 628d8f6 + 733a509 commit 115b57e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/session/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class SnekSession extends CookieSession {
async customTask<T>(type: string, data: DocumentNode, variables: object) {
return this.tasks.run<T>(type, data, {
...variables,
token: this.token,
token: await this.upToDateToken(),
refreshToken: this.refreshToken,
});
}
Expand Down
6 changes: 5 additions & 1 deletion src/templates/snek/gql/tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class SnekTasks extends TaskError {
this.user = new SnekGqlUserTasks(this);
}

async run<T>(type: string, query: DocumentNode, variables: object) {
async run<T>(
type: string,
query: DocumentNode,
variables: object
): Promise<ApolloResult<T>> {
let response: ApolloResult<T>;

if (type === "query") {
Expand Down

0 comments on commit 115b57e

Please sign in to comment.