Skip to content

Instantly share code, notes, and snippets.

@thomsbg
Last active May 7, 2020 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomsbg/280b26193f38a243dc81a3a19307698f to your computer and use it in GitHub Desktop.
Save thomsbg/280b26193f38a243dc81a3a19307698f to your computer and use it in GitHub Desktop.
No parent container
interface EntryRevision {
title: String
body: EntryBody
# etc
}
# A published unit of content
type Entry implements EntryRevision {
draft: EntryDraft
}
# A draft unit of content. The primary type used by the story editor.
type EntryDraft implements EntryRevision {
id: ID # same as Entry? or perhaps ":uuid/draft"
publishedEntry: Entry
publishStatus: DRAFT | PUBLISHED | UPDATED
approvalStatus: DRAFT | SUBMITTED | APPROVED
}
type Query {
# fetch the published entry by id. will return null if it's not published.
entry(id: ID): Entry
# fetch the entry by id. will return something regardless of publish status.
entryDraft(id: ID): EntryDraft
}
type Mutation {
# Create a published Entry. An EntryDraft will be created to match.
createEntry
# Create an unpublished EntryDraft
createEntryDraft
# Update a published Entry. The corresponding EntryDraft remains unchanged.
updateEntry
# Update an EntryDraft. The Entry remains unchanged.
updateEntryDraft
# Create or update a published entry. An EntryDraft will be created/updated to match.
createOrUpdateEntry
createOrUpdateEntryDraft
# Only EntryDraft may be published (or re-published).
publishEntryDraft
# Only EntryDraft may be scheduled to publish.
scheduleEntryDraftPublish
# Only published entries may be hidden.
hideEntry
}
input EntryUpdateInput {
# You could potentially update the EntryDraft in the same mutation if you wanted.
draft: EntryDraftUpdateInput
title: String
body: EntryBodyInput
}
input EntryDraftUpdateInput {
title: String
body: EntryBodyInput
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment