From ffca5026254fb0af7c70ebb3a7d325af9565d24d Mon Sep 17 00:00:00 2001 From: keyan Date: Tue, 7 Sep 2021 08:25:19 -0500 Subject: [PATCH] write updated usernames to cache --- components/user-header.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/components/user-header.js b/components/user-header.js index ccfd9e58..5c657a97 100644 --- a/components/user-header.js +++ b/components/user-header.js @@ -71,9 +71,20 @@ export default function UserHeader ({ user }) { } router.replace(`/${name}`) session.user.name = name - user.name = name + + client.writeFragment({ + id: `User:${user.id}`, + fragment: gql` + fragment CurUser on User { + name + } + `, + data: { + name + } + }) + setEditting(false) - // alternative is setting window.location = /name }} >