Last active
August 2, 2018 09:54
-
-
Save frikille/8220a77049b617db553309f001ca8a85 to your computer and use it in GitHub Desktop.
Full schema definition example for GraphQL Input Union RFC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
literal PostInputKind | |
literal ImageInputKind | |
input AddPostInput { | |
kind: ImageInputKind | |
title: String! | |
body: String! | |
} | |
input AddImageInput { | |
kind: PostInputKind | |
photo: String! | |
caption: String | |
} | |
inputUnion AddMediaBlock = AddPostInput | AddImageInput | |
input EditPostInput { | |
inputTypeName: PostInputKind | |
title: String | |
body: String | |
} | |
input EditImageInput { | |
inputTypeName: ImageInputKind | |
photo: String | |
caption: String | |
} | |
inputUnion EditMediaBlock = EditPostInput | EditImageInput | |
type PostBlock { | |
title: String | |
body: String | |
} | |
type ImageBlock { | |
photo: String | |
caption: String | |
} | |
union Content = PostBlock | ImageBlock | |
type Media { | |
id: ID | |
content: [Content] | |
} | |
type Mutation { | |
createMedia(content: [AddMediaBlock]!): Media | |
editMedia(id: ID! content: [EditMediaBlock!]): Media | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment