fragment pipelineFields on pipeline {
    id
    pipeline_id
    owner_id
    created_at
    updated_at
    visibility
    pipeline_tags {
        id
        pipeline_pk_id
        tag_pk_id
        tag {
            id
            tag
        }
    }
    pipeline_versions {
        version
        created_at
        updated_at
        deployment_pipeline_versions {
            deployment {
                deployed
                engine_config
            }
        }
    }
    deployment {
      deployed
    }
}

query GetPipelineByName($pipeline_id: String, $workspace_id: bigint) {
    pipeline(where: { pipeline_id: { _eq: $pipeline_id }, workspace_id: { _eq: $workspace_id } }) {
        ...pipelineFields
    }
}