search: add graphQL schema and stubs for code monitoring
Created by: stefanhengl
This PR adds code-monitors to our GraphQL schema. The goal is to first merge a stub implementation to unlock frontend work.
The schema follows this design. There are still some things missing (events, mutations, mock-store), but I wanted to break it down to limit the size of the PRs.
For the review, I think the most important parts are the changes to the schema.graphql
and user.go
.
Here is an example of a query that will work:
{
user(username: "stefan") {
monitors(first: 1) {
nodes {
id
createdBy {
username
}
createdAt
description
owner {
__typename
... on User {
username
}
}
trigger {
__typename
... on MonitorQuery {
query
}
}
actions(first: 1) {
nodes {
... on MonitorEmail {
recipient {
__typename
... on User {
username
}
}
priority
enabled
header
}
}
totalCount
}
}
totalCount
}
}
}
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #15184 into main will decrease coverage by
0.02%
. The diff coverage is14.28%
.@@ Coverage Diff @@ ## main #15184 +/- ## ========================================== - Coverage 52.71% 52.68% -0.03% ========================================== Files 1606 1607 +1 Lines 80246 80288 +42 Branches 7003 7056 +53 ========================================== + Hits 42298 42300 +2 - Misses 34144 34184 +40 Partials 3804 3804
Flag Coverage Δ go 52.62% <14.28%> (-0.03%)
integration 30.69% <ø> (-0.11%)
storybook 26.10% <ø> (ø)
typescript 52.83% <ø> (-0.02%)
unit 34.27% <ø> (ø)
Impacted Files Coverage Δ cmd/frontend/graphqlbackend/code_monitors.go 0.00% <0.00%> (ø)
cmd/frontend/graphqlbackend/user.go 32.11% <0.00%> (-0.72%)
cmd/frontend/graphqlbackend/graphqlbackend.go 53.46% <100.00%> (+1.16%)
...ient/web/src/search/input/LazyMonacoQueryInput.tsx 77.77% <0.00%> (-22.23%)
client/web/src/repo/RepoContainer.tsx 77.77% <0.00%> (-0.93%)
cmd/repo-updater/repos/types.go 74.20% <0.00%> (-0.25%)
Please register or sign in to reply