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
}
}
}