drafts-gql
This commit is contained in:
parent
cd6ecce305
commit
547eecc279
28
src/graphql/mutation/draft-create.ts
Normal file
28
src/graphql/mutation/draft-create.ts
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
9
src/graphql/mutation/draft-destroy.ts
Normal file
9
src/graphql/mutation/draft-destroy.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import { gql } from '@urql/core'
|
||||||
|
|
||||||
|
export default gql`
|
||||||
|
mutation DraftDestroyMutation($draft: Int!) {
|
||||||
|
deleteDraft(draft: $draft) {
|
||||||
|
error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
28
src/graphql/mutation/draft-update.ts
Normal file
28
src/graphql/mutation/draft-update.ts
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
Loading…
Reference in New Issue
Block a user