Skip to content

Commit

Permalink
add project refs and move fragments next to queries and mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Jun 13, 2024
1 parent 5a79fa1 commit 4000893
Show file tree
Hide file tree
Showing 17 changed files with 2,510 additions and 2,349 deletions.
3,951 changes: 2,069 additions & 1,882 deletions client.go

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions graph/backup.graphql
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
fragment ClusterBackupFragment on ClusterBackup {
id
name
cluster { id }
garbageCollected
}

fragment ClusterRestoreFragment on ClusterRestore {
id
status
backup { ... ClusterBackupFragment}
}

mutation CreateClusterBackup($attributes: BackupAttributes!) {
createClusterBackup(attributes: $attributes) {
... ClusterBackupFragment
...ClusterBackupFragment
}
}

query GetClusterBackup($id: ID, $clusterId: ID, $namespace: String, $name: String) {
clusterBackup(id: $id, clusterId: $clusterId, namespace: $namespace, name: $name) {
... ClusterBackupFragment
...ClusterBackupFragment
}
}

mutation UpdateClusterRestore($id: ID!, $attributes: RestoreAttributes!) {
updateClusterRestore(id: $id, attributes: $attributes) {
... ClusterRestoreFragment
...ClusterRestoreFragment
}
}

mutation CreateClusterRestore($backupId: ID!) {
createClusterRestore(backupId: $backupId) {
... ClusterRestoreFragment
...ClusterRestoreFragment
}
}

query GetClusterRestore($id: ID!) {
clusterRestore(id: $id) {
... ClusterRestoreFragment
...ClusterRestoreFragment
}
}

79 changes: 79 additions & 0 deletions graph/cluster.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
fragment ClusterFragment on Cluster {
id
name
handle
self
version
insertedAt
pingedAt
protect
currentVersion
kasUrl
deletedAt
metadata
tags { ...ClusterTags }
credential { ...ProviderCredentialFragment }
provider { ...ClusterProviderFragment }
nodePools { ...NodePoolFragment }
status { ...ClusterStatusFragment }
project {...TinyProjectFragment }
}

fragment ClusterTags on Tag {
name
value
}

fragment ClusterProviderFragment on ClusterProvider {
id
name
namespace
cloud
editable
deletedAt
repository {
...GitRepositoryFragment
}
service {
...ServiceDeploymentFragment
}
credentials {
...ProviderCredentialFragment
}
}

fragment NodePoolFragment on NodePool {
id
name
minSize
maxSize
instanceType
labels
taints {
...NodePoolTaintFragment
}
}

fragment NodePoolTaintFragment on Taint {
key
value
effect
}

fragment ClusterStatusFragment on ClusterStatus {
conditions { ...ClusterConditionFragment }
controlPlaneReady
failureMessage
failureReason
phase
}

fragment ClusterConditionFragment on ClusterCondition {
lastTransitionTime
status
type
message
reason
severity
}

mutation CreateCluster($attributes: ClusterAttributes!) {
createCluster(attributes: $attributes) {
deployToken
Expand Down
18 changes: 9 additions & 9 deletions graph/gates.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
query GetClusterGates {
clusterGates {
...PipelineGateFragment
}
...PipelineGateFragment
}
}

query PagedClusterGates($after: String, $first: Int, $before: String, $last: Int){
Expand Down Expand Up @@ -32,7 +32,7 @@ fragment GateSpecFragment on GateSpec {
}

fragment GateStatusFragment on GateStatus {
jobRef { ...JobReferenceFragment }
jobRef { ...JobReferenceFragment }
}

fragment JobSpecFragment on JobGateSpec {
Expand All @@ -45,8 +45,8 @@ fragment JobSpecFragment on JobGateSpec {
}

fragment JobReferenceFragment on JobReference {
name
namespace
name
namespace
}

fragment ContainerSpecFragment on ContainerSpec {
Expand All @@ -63,11 +63,11 @@ fragment ContainerSpecFragment on ContainerSpec {
}

mutation updateGate($id: ID!, $attributes: GateUpdateAttributes!) {
updateGate(id: $id, attributes: $attributes) {
...PipelineGateFragment
}
updateGate(id: $id, attributes: $attributes) {
...PipelineGateFragment
}
}

query GetClusterGate($id: ID!) {
clusterGate(id: $id) { ...PipelineGateFragment }
clusterGate(id: $id) { ...PipelineGateFragment }
}
11 changes: 10 additions & 1 deletion graph/git.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
fragment GitRepositoryFragment on GitRepository {
id
error
health
authMethod
url
decrypt
}

mutation CreateGitRepository($attributes: GitAttributes!) {
createGitRepository(attributes: $attributes) {
...GitRepositoryFragment
Expand All @@ -19,7 +28,7 @@ mutation DeleteGitRepository($id: ID!) {
query ListGitRepositories($cursor: String, $before: String, $last: Int) {
gitRepositories(after: $cursor, first: 100, before: $before, last: $last) {
edges {
...GitRepositoryEdgeFragment
...GitRepositoryEdgeFragment
}
}
}
Expand Down
Loading

0 comments on commit 4000893

Please sign in to comment.