Add jobs field to project query
Why
We are refactoring the jobs index view to Vue/GraphQL. We need a performant way to fetch all the jobs for a project.
Problem
Currently to fetch jobs for a project you need to first fetch all the pipelines for a project. Which not very performant.
😞
Bad query getJobs($fullPath: ID!) {
project(fullPath: $fullPath) {
pipelines(first: 15) {
nodes {
jobs {
nodes {
name
...
Solution
We need to be able to fetch jobs directly for a project by adding a jobs field to the project query.
😸
Good query getJobs($fullPath: ID!) {
project(fullPath: $fullPath) {
jobs(first: 15) {
nodes {
name
...
Edited by Payton Burdette