Merge pull request #4171 from omnivore-app/fix/web-label-update-gql

Fix string interp on update label mutation
This commit is contained in:
Jackson Harper 2024-07-09 11:57:41 +08:00 committed by GitHub
commit ee6cd036c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,15 +12,8 @@ export async function updateLabelMutation(
input: UpdateLabelInput
): Promise<string | undefined> {
const mutation = gql`
mutation {
updateLabel(
input: {
color: "${input.color}"
name: "${input.name}"
description: "${input.description}"
labelId: "${input.labelId}"
}
) {
mutation UpdateLabel($input: UpdateLabelInput!) {
updateLabel(input: $input) {
... on UpdateLabelSuccess {
label {
id
@ -38,7 +31,9 @@ export async function updateLabelMutation(
`
try {
const data = await gqlFetcher(mutation)
const data = await gqlFetcher(mutation, {
input,
})
const output = data as any
return output?.updatedLabel
} catch (err) {