Skip to content

Instantly share code, notes, and snippets.

@kinow
Last active May 20, 2020 02:22
Show Gist options
  • Select an option

  • Save kinow/d505938ccb5f3dfe87c585ddb333956a to your computer and use it in GitHub Desktop.

Select an option

Save kinow/d505938ccb5f3dfe87c585ddb333956a to your computer and use it in GitHub Desktop.
subscription OnWorkflowDeltasData ($workflowId: ID) {
deltas (workflows: [$workflowId]) {
...WorkflowTreeDeltas
...WorkflowGraphDeltas
}
}
# GRAPH DELTAS BEGIN
# TODO: incomplete as the graph component is not using deltas (yet!)
# but useful for testing the subscription and fragments
fragment WorkflowGraphDeltas on Deltas {
id
added {
...WorkflowGraphAddedData
}
}
fragment WorkflowGraphAddedData on Added {
edges {
id
source
target
}
}
# GRAPH DELTAS END
# TREE DELTAS BEGIN
fragment WorkflowTreeDeltas on Deltas {
id
shutdown
added {
...WorkflowTreeAddedData
}
updated {
...WorkflowTreeUpdatedData
}
pruned {
...WorkflowTreePrunedData
}
}
fragment WorkflowTreeAddedData on Added {
workflow {
...WorkflowData
cyclePoints: familyProxies(ids: ["root"], ghosts: true) {
cyclePoint
}
taskProxies(sort: { keys: ["cyclePoint"] }, ghosts: true) {
...TaskProxyData
jobs(sort: { keys: ["submit_num"], reverse:true }) {
...JobData
}
}
familyProxies (exids: ["root"], sort: { keys: ["firstParent"]}, ghosts: true) {
...FamilyProxyData
}
}
cyclePoints: familyProxies(ids: ["root"], ghosts: true) {
cyclePoint
}
familyProxies (exids: ["root"], sort: { keys: ["firstParent"]}, ghosts: true) {
...FamilyProxyData
}
taskProxies(sort: { keys: ["cyclePoint"] }, ghosts: true) {
...TaskProxyData
}
jobs(sort: { keys: ["submit_num"], reverse:true }) {
...JobData
}
}
fragment WorkflowTreeUpdatedData on Updated {
taskProxies(sort: { keys: ["cyclePoint"] }, ghosts: true) {
...TaskProxyData
}
jobs(sort: { keys: ["submit_num"], reverse:true }) {
...JobData
}
familyProxies (exids: ["root"], sort: { keys: ["firstParent"]}, ghosts: true) {
...FamilyProxyData
}
}
fragment WorkflowTreePrunedData on Pruned {
jobs
taskProxies
familyProxies
}
# TREE DELTAS END
# WORKFLOW DATA BEGIN
fragment WorkflowData on Workflow {
id
name
status
owner
host
port
}
fragment FamilyProxyData on FamilyProxy {
id
name
state
cyclePoint
firstParent {
id
name
cyclePoint
state
}
}
fragment TaskProxyData on TaskProxy {
id
name
state
isHeld
cyclePoint
latestMessage
firstParent {
id
name
cyclePoint
state
}
task {
meanElapsedTime
name
}
}
fragment JobData on Job {
id
firstParent: taskProxy {
id
}
batchSysName
batchSysJobId
host
startedTime
submittedTime
finishedTime
state
submitNum
}
# WORKFLOW DATA END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment