Pass in updatePageInput so we can have null values

This commit is contained in:
Jackson Harper
2022-06-09 15:50:59 -07:00
parent ea4e4d6828
commit a99303a261

View File

@ -11,14 +11,10 @@ export async function updatePageMutation(
input: UpdatePageInput
): Promise<string | undefined> {
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) {