Skip to content

Commit 214ca59

Browse files
committed
Update cache mutation and task
The cacheing task requires a person name now.
1 parent f077450 commit 214ca59

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/templates/snek/gql/mutations/user.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ const registration = gql`
4141
* @description A mutation to cache user information server side
4242
*/
4343
const cache = gql`
44-
mutation cache($token: String!, $cache: String!) {
45-
cache: cacheUser(token: $token, cache: $cache) {
46-
user {
44+
mutation cache($token: String!, $personName: String!, $cache: String!) {
45+
cache: cacheUser(token: $token, personName: $personName, cache: $cache) {
46+
personPage {
4747
id
4848
}
4949
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,20 @@ class SnekGqlUserTasks {
111111
/**
112112
* Cache a user.
113113
*
114+
* @param {string} personName The name of a users person page
114115
* @param {string} cache A serialized JSON object to be cached
115116
* @returns {Promise<ApolloResult<CacheData>>} Cache data
116117
*/
117-
async cache(cache: string): Promise<ApolloResult<CacheData>> {
118+
async cache(
119+
personName: string,
120+
cache: string
121+
): Promise<ApolloResult<CacheData>> {
118122
const response = await this.parent.run<CacheData>(
119123
"mutation",
120124
this.parent.template.mutations.user.cache,
121125
{
122126
token: await this.parent.session.upToDateToken(),
127+
personName,
123128
cache,
124129
}
125130
);

0 commit comments

Comments
 (0)