Last active
July 26, 2018 15:57
-
-
Save frikille/b008883eab9cdaeb2811fd838ce399a7 to your computer and use it in GitHub Desktop.
GraphQL input union proposal
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
interface AddMediaBlock = { | |
inputTypeName: AddMediaBlockInputTypeNameEnum! | |
} | |
enum AddMediaBlockInputTypeNameEnum { | |
AddPostInput | |
AddImageInput | |
} | |
input AddPostInput implements AddMediaBlockInterface { | |
kind: AddMediaBlockInputEnum! | |
title: String! | |
body: String! | |
} | |
input AddImageInput implements AddMediaBlockInterface { | |
kind: AddMediaBlockInputEnum! | |
photo: String! | |
caption: String | |
} | |
interface EditMediaBlock = { | |
inputTypeName: EditMediaBlockInputTypeNameEnum! | |
} | |
enum EditMediaBlockInputTypeNameEnum { | |
EditPostInput | |
EditImageInput | |
} | |
input EditPostInput implements EditMediaBlock { | |
inputTypeName: EditMediaBlockInputTypeNameEnum! | |
title: String | |
body: String | |
} | |
input EditImageInput implements EditMediaBlock { | |
inputTypeName: EditMediaBlockInputTypeNameEnum! | |
photo: String | |
caption: String | |
} | |
type Mutation { | |
addContent(content: [AddMediaBlock]!): Post | |
editContent(content: EditMediaBlock!): Post | |
} |
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
enum AddMediaBlockInputEnum { | |
AddPostInput | |
AddImageInput | |
} | |
enum EditMediaBlockInputEnum { | |
EditPostInput | |
EditImageInput | |
} | |
interface AddMediaBlockInterface { | |
kind: AddMediaBlockInputEnum! | |
} | |
interface AddMediaBlockInterface { | |
kind: AddMediaBlockInputEnum! | |
} | |
input AddPostInput implements AddMediaBlockInterface { | |
kind: AddMediaBlockInputEnum! | |
title: String! | |
body: String! | |
} | |
input AddImageInput implements AddMediaBlockInterface { | |
kind: AddMediaBlockInputEnum! | |
photo: String! | |
caption: String | |
} | |
inputunion AddMediaBlockInput = AddPostInput | AddImageInput; | |
input EditPostInput { | |
kind: EditMediaBlockInputEnum! | |
title: String | |
body: String | |
} | |
input EditImageInput { | |
kind: EditMediaBlockInputEnum! | |
photo: String | |
caption: String | |
} | |
inputunion EditMediaBlockInput = EditPostInput | EditImageInput; | |
type Mutation { | |
addContent(content: [AddMediaBlock]!): Post | |
editContent(content: EditMediaBlock!): Post | |
} |
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
enum AddMediaBlockInputEnum { | |
AddPostInput | |
AddImageInput | |
} | |
enum EditMediaBlockInputEnum { | |
EditPostInput | |
EditImageInput | |
} | |
input AddPostInput { | |
kind: AddMediaBlockInputEnum! | |
title: String! | |
body: String! | |
} | |
input AddImageInput { | |
kind: AddMediaBlockInputEnum! | |
photo: String! | |
caption: String | |
} | |
inputunion AddMediaBlockInput = AddPostInput | AddImageInput; | |
input EditPostInput { | |
kind: EditMediaBlockInputEnum! | |
title: String | |
body: String | |
} | |
input EditImageInput { | |
kind: EditMediaBlockInputEnum! | |
photo: String | |
caption: String | |
} | |
inputunion EditMediaBlockInput = EditPostInput | EditImageInput; | |
type Mutation { | |
addContent(content: [AddMediaBlock]!): Post | |
editContent(content: EditMediaBlock!): Post | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment