drafts-gql

This commit is contained in:
tonyrewin 2023-02-20 18:30:52 +03:00
parent cd6ecce305
commit 547eecc279
4 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,28 @@
import { gql } from '@urql/core'
export default gql`
mutation DraftCreateMutation($draft: DraftInput!) {
createDraft(draft: $draft) {
error
draft {
id
slug
title
subtitle
body
topics {
# id
title
slug
}
authors {
id
name
slug
userpic
caption
}
}
}
}
`

View File

@ -0,0 +1,9 @@
import { gql } from '@urql/core'
export default gql`
mutation DraftDestroyMutation($draft: Int!) {
deleteDraft(draft: $draft) {
error
}
}
`

View File

@ -0,0 +1,28 @@
import { gql } from '@urql/core'
export default gql`
mutation DraftUpdateMutation($draft: DraftInput!) {
updateDraft(draft: $draft) {
error
draft {
id
slug
title
subtitle
body
topics {
# id
title
slug
}
authors {
id
name
slug
userpic
caption
}
}
}
}
`