From a99303a261dae5937ac8d46360d3e86b62c82cce Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 9 Jun 2022 15:50:59 -0700 Subject: [PATCH] Pass in updatePageInput so we can have null values --- .../networking/mutations/updatePageMutation.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/web/lib/networking/mutations/updatePageMutation.ts b/packages/web/lib/networking/mutations/updatePageMutation.ts index 494d5f96c..f499eb5ed 100644 --- a/packages/web/lib/networking/mutations/updatePageMutation.ts +++ b/packages/web/lib/networking/mutations/updatePageMutation.ts @@ -11,14 +11,10 @@ export async function updatePageMutation( input: UpdatePageInput ): Promise { const mutation = gql` - mutation { - updatePage( - input: { - pageId: "${input.pageId}" - title: "${input.title}" - description: "${input.description}" - } - ) { + mutation UpdatePage( + $input: UpdatePageInput! + ) { + updatePage(input: $input) { ... on UpdatePageSuccess { updatedPage { id @@ -39,7 +35,9 @@ export async function updatePageMutation( ` try { - const data = await gqlFetcher(mutation) + const data = await gqlFetcher(mutation, { + input, + }) const output = data as any return output.updatePage } catch (err) {