diff --git a/src/v3/plugins/github/nodes.js b/src/v3/plugins/github/nodes.js index 6a72b10..c33746a 100644 --- a/src/v3/plugins/github/nodes.js +++ b/src/v3/plugins/github/nodes.js @@ -31,7 +31,7 @@ export type ReviewAddress = {| |}; export type CommentAddress = {| +type: "COMMENT", - +parent: IssueAddress | PullAddress | ReviewAddress, + +parent: CommentableAddress, +id: string, |}; export type UserlikeAddress = {| @@ -90,6 +90,12 @@ export type ParentAddress = | PullAddress | ReviewAddress; +// Each of these types may have Comments as children +export type CommentableAddress = IssueAddress | PullAddress | ReviewAddress; + +// Verify that Commentable is a subtype of Parent +const _unused_static = (_: CommentableAddress): ParentAddress => _; + export function fromRaw(x: RawAddress): StructuredAddress { function fail() { return new Error(`Bad address: ${NodeAddress.toString(x)}`);