Skip to content

Instantly share code, notes, and snippets.

@thomsbg
Created October 3, 2017 17:52
Show Gist options
  • Save thomsbg/6f0e0526d1f7447c2475773f146e5b24 to your computer and use it in GitHub Desktop.
Save thomsbg/6f0e0526d1f7447c2475773f146e5b24 to your computer and use it in GitHub Desktop.
fragment StoryData {
title: String
image: Image
body: RichText
...
}
enum StoryStatus {
DRAFT
PENDING_APPROVAL
APPROVED
EMBARGOED
}
type DraftStoryData {
...StoryData
status: StoryStatus
}
type PublicStoryData implements StoryData {
...StoryData
commentsClosed: Boolean
}
type Story {
id: Int
draft: DraftStoryData
public: PublicStoryData
}
type Query {
storyById(id: Int): Story
}
type Mutation {
publishStory(id: Int)
saveStoryDraft(id: Int, version: Int, patch: JSON0)
changeCommentsClosed(id: Int, closed: Boolean)
}
---
storyById(id: 1234) {
draft {
title
}
public {
commentsClosed
}
}
saveStoryDraft(id: 1234, version: 2, patch: [{ p: ['title'], oi: 'New Title' }])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment