diff options
author | Michael Muré <batolettre@gmail.com> | 2024-08-28 11:43:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-28 09:43:42 +0000 |
commit | 57e7147021e38b847213d4dc7f0e0bf0b022850d (patch) | |
tree | 882650697950003e2325f0815353032a8596ca1d /webui/src | |
parent | e45c3c5ee6dc5650fd8c3f480d9e09e5f3b221fd (diff) | |
download | git-bug-57e7147021e38b847213d4dc7f0e0bf0b022850d.tar.gz |
graphql: properly namespace Bug to make space for other entities (#1254)
Also: use gqlgen directives to help the type auto-binding
Missing:
- namespace mutations
- adapt the webUI queries
Diffstat (limited to 'webui/src')
18 files changed, 36 insertions, 36 deletions
diff --git a/webui/src/components/BugTitleForm/SetTitle.graphql b/webui/src/components/BugTitleForm/SetTitle.graphql index 9dc2d096..8477b1e2 100644 --- a/webui/src/components/BugTitleForm/SetTitle.graphql +++ b/webui/src/components/BugTitleForm/SetTitle.graphql @@ -1,5 +1,5 @@ -mutation setTitle($input: SetTitleInput!) { - setTitle(input: $input) { +mutation setTitle($input: BugSetTitleInput!) { + bugSetTitle(input: $input) { bug { id } diff --git a/webui/src/components/CloseBugButton/CloseBug.graphql b/webui/src/components/CloseBugButton/CloseBug.graphql index fc03d1f3..bfcb1a60 100644 --- a/webui/src/components/CloseBugButton/CloseBug.graphql +++ b/webui/src/components/CloseBugButton/CloseBug.graphql @@ -1,6 +1,6 @@ # Write your query or mutation here -mutation closeBug($input: CloseBugInput!) { - closeBug(input: $input) { +mutation closeBug($input: BugStatusCloseInput!) { + bugStatusClose(input: $input) { bug { id } diff --git a/webui/src/components/CloseBugWithCommentButton/CloseBugWithComment.graphql b/webui/src/components/CloseBugWithCommentButton/CloseBugWithComment.graphql index 66c84c35..aaa36184 100644 --- a/webui/src/components/CloseBugWithCommentButton/CloseBugWithComment.graphql +++ b/webui/src/components/CloseBugWithCommentButton/CloseBugWithComment.graphql @@ -1,5 +1,5 @@ -mutation AddCommentAndCloseBug($input: AddCommentAndCloseBugInput!) { - addCommentAndClose(input: $input) { +mutation AddCommentAndCloseBug($input: BugAddCommentAndCloseInput!) { + bugAddCommentAndClose(input: $input) { statusOperation { status } diff --git a/webui/src/components/ReopenBugButton/OpenBug.graphql b/webui/src/components/ReopenBugButton/OpenBug.graphql index 12673e65..69f39058 100644 --- a/webui/src/components/ReopenBugButton/OpenBug.graphql +++ b/webui/src/components/ReopenBugButton/OpenBug.graphql @@ -1,5 +1,5 @@ -mutation openBug($input: OpenBugInput!) { - openBug(input: $input) { +mutation openBug($input: BugStatusOpenInput!) { + bugStatusOpen(input: $input) { bug { id } diff --git a/webui/src/components/ReopenBugWithCommentButton/ReopenBugWithComment.graphql b/webui/src/components/ReopenBugWithCommentButton/ReopenBugWithComment.graphql index 5258a1aa..30e0d206 100644 --- a/webui/src/components/ReopenBugWithCommentButton/ReopenBugWithComment.graphql +++ b/webui/src/components/ReopenBugWithCommentButton/ReopenBugWithComment.graphql @@ -1,5 +1,5 @@ -mutation AddCommentAndReopenBug($input: AddCommentAndReopenBugInput!) { - addCommentAndReopen(input: $input) { +mutation AddCommentAndReopenBug($input: BugAddCommentAndReopenInput!) { + bugAddCommentAndReopen(input: $input) { statusOperation { status } diff --git a/webui/src/pages/bug/CommentForm.graphql b/webui/src/pages/bug/CommentForm.graphql index f4b61850..37ed842a 100644 --- a/webui/src/pages/bug/CommentForm.graphql +++ b/webui/src/pages/bug/CommentForm.graphql @@ -1,5 +1,5 @@ -mutation AddComment($input: AddCommentInput!) { - addComment(input: $input) { +mutation AddComment($input: BugAddCommentInput!) { + bugAddComment(input: $input) { operation { id } diff --git a/webui/src/pages/bug/EditCommentForm.graphql b/webui/src/pages/bug/EditCommentForm.graphql index 4765b75c..05da2824 100644 --- a/webui/src/pages/bug/EditCommentForm.graphql +++ b/webui/src/pages/bug/EditCommentForm.graphql @@ -1,8 +1,8 @@ #import "./MessageCommentFragment.graphql" #import "./MessageCreateFragment.graphql" -mutation EditComment($input: EditCommentInput!) { - editComment(input: $input) { +mutation EditComment($input: BugEditCommentInput!) { + bugEditComment(input: $input) { bug { id timeline { diff --git a/webui/src/pages/bug/EditCommentForm.tsx b/webui/src/pages/bug/EditCommentForm.tsx index b265735b..3a3eaf2c 100644 --- a/webui/src/pages/bug/EditCommentForm.tsx +++ b/webui/src/pages/bug/EditCommentForm.tsx @@ -63,7 +63,7 @@ function EditCommentForm({ bug, comment, onCancel, onPostSubmit }: Props) { }, }, }).then((result) => { - const comments = result.data?.editComment.bug.timeline.comments as ( + const comments = result.data?.bugEditComment.bug.timeline.comments as ( | AddCommentFragment | CreateFragment )[]; diff --git a/webui/src/pages/bug/LabelChangeFragment.graphql b/webui/src/pages/bug/LabelChangeFragment.graphql index 82d41235..f00bf034 100644 --- a/webui/src/pages/bug/LabelChangeFragment.graphql +++ b/webui/src/pages/bug/LabelChangeFragment.graphql @@ -1,6 +1,6 @@ #import "../../components/fragments.graphql" -fragment LabelChange on LabelChangeTimelineItem { +fragment LabelChange on BugLabelChangeTimelineItem { date ...authored added { diff --git a/webui/src/pages/bug/MessageCommentFragment.graphql b/webui/src/pages/bug/MessageCommentFragment.graphql index c852b4b0..1482b05a 100644 --- a/webui/src/pages/bug/MessageCommentFragment.graphql +++ b/webui/src/pages/bug/MessageCommentFragment.graphql @@ -1,6 +1,6 @@ #import "../../components/fragments.graphql" -fragment AddComment on AddCommentTimelineItem { +fragment AddComment on BugAddCommentTimelineItem { id createdAt ...authored diff --git a/webui/src/pages/bug/MessageCreateFragment.graphql b/webui/src/pages/bug/MessageCreateFragment.graphql index 1f4647b6..14c0f0f1 100644 --- a/webui/src/pages/bug/MessageCreateFragment.graphql +++ b/webui/src/pages/bug/MessageCreateFragment.graphql @@ -1,6 +1,6 @@ #import "../../components/fragments.graphql" -fragment Create on CreateTimelineItem { +fragment Create on BugCreateTimelineItem { id createdAt ...authored diff --git a/webui/src/pages/bug/SetStatusFragment.graphql b/webui/src/pages/bug/SetStatusFragment.graphql index d8380409..2404e809 100644 --- a/webui/src/pages/bug/SetStatusFragment.graphql +++ b/webui/src/pages/bug/SetStatusFragment.graphql @@ -1,6 +1,6 @@ #import "../../components/fragments.graphql" -fragment SetStatus on SetStatusTimelineItem { +fragment SetStatus on BugSetStatusTimelineItem { date ...authored status diff --git a/webui/src/pages/bug/SetTitleFragment.graphql b/webui/src/pages/bug/SetTitleFragment.graphql index 2225dfd3..b226bff5 100644 --- a/webui/src/pages/bug/SetTitleFragment.graphql +++ b/webui/src/pages/bug/SetTitleFragment.graphql @@ -1,6 +1,6 @@ #import "../../components/fragments.graphql" -fragment SetTitle on SetTitleTimelineItem { +fragment SetTitle on BugSetTitleTimelineItem { date ...authored title diff --git a/webui/src/pages/bug/Timeline.tsx b/webui/src/pages/bug/Timeline.tsx index fc88edd7..b9601dc1 100644 --- a/webui/src/pages/bug/Timeline.tsx +++ b/webui/src/pages/bug/Timeline.tsx @@ -27,15 +27,15 @@ function Timeline({ bug, ops }: Props) { <div className={classes.main}> {ops.map((op, index) => { switch (op.__typename) { - case 'CreateTimelineItem': + case 'BugCreateTimelineItem': return <Message key={index} op={op} bug={bug} />; - case 'AddCommentTimelineItem': + case 'BugAddCommentTimelineItem': return <Message key={index} op={op} bug={bug} />; - case 'LabelChangeTimelineItem': + case 'BugLabelChangeTimelineItem': return <LabelChange key={index} op={op} />; - case 'SetTitleTimelineItem': + case 'BugSetTitleTimelineItem': return <SetTitle key={index} op={op} />; - case 'SetStatusTimelineItem': + case 'BugSetStatusTimelineItem': return <SetStatus key={index} op={op} />; } diff --git a/webui/src/pages/bug/TimelineQuery.graphql b/webui/src/pages/bug/TimelineQuery.graphql index 7c9badfd..057b798a 100644 --- a/webui/src/pages/bug/TimelineQuery.graphql +++ b/webui/src/pages/bug/TimelineQuery.graphql @@ -21,20 +21,20 @@ query Timeline($id: String!, $first: Int = 10, $after: String) { } } -fragment TimelineItem on TimelineItem { - ... on LabelChangeTimelineItem { +fragment TimelineItem on BugTimelineItem { + ... on BugLabelChangeTimelineItem { ...LabelChange } - ... on SetStatusTimelineItem { + ... on BugSetStatusTimelineItem { ...SetStatus } - ... on SetTitleTimelineItem { + ... on BugSetTitleTimelineItem { ...SetTitle } - ... on AddCommentTimelineItem { + ... on BugAddCommentTimelineItem { ...AddComment } - ... on CreateTimelineItem { + ... on BugCreateTimelineItem { ...Create } } diff --git a/webui/src/pages/bug/labels/SetLabel.graphql b/webui/src/pages/bug/labels/SetLabel.graphql index 6f4ad510..e2e637a0 100644 --- a/webui/src/pages/bug/labels/SetLabel.graphql +++ b/webui/src/pages/bug/labels/SetLabel.graphql @@ -1,5 +1,5 @@ -mutation SetLabel($input: ChangeLabelInput) { - changeLabels(input: $input) { +mutation SetLabel($input: BugChangeLabelInput) { + bugChangeLabels(input: $input) { results { status label { diff --git a/webui/src/pages/new/NewBug.graphql b/webui/src/pages/new/NewBug.graphql index ef024e41..664f0897 100644 --- a/webui/src/pages/new/NewBug.graphql +++ b/webui/src/pages/new/NewBug.graphql @@ -1,5 +1,5 @@ -mutation newBug($input: NewBugInput!) { - newBug(input: $input) { +mutation newBug($input: BugCreateInput!) { + bugCreate(input: $input) { bug { id } diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx index 0852ef39..91e4905a 100644 --- a/webui/src/pages/new/NewBugPage.tsx +++ b/webui/src/pages/new/NewBugPage.tsx @@ -62,7 +62,7 @@ function NewBugPage() { }, }, }).then(function (data) { - const id = data.data?.newBug.bug.id; + const id = data.data?.bugCreate.bug.id; navigate('/bug/' + id); }); |