-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add agents, graphs, orgs, and update blobstores
- Loading branch information
Showing
4 changed files
with
232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
[operations] | ||
|
||
QUERY_GET_AGENT = """ | ||
query QUERY_GET_AGENT($agentId: ID!) { | ||
agents (where: {id: $agentId}) { | ||
id | ||
label | ||
createdTimestamp | ||
namespace | ||
} | ||
} | ||
""" | ||
|
||
GQL_ADD_AGENTS = """ | ||
mutation addAgents($input: [AgentCreateInput!]!) { | ||
addAgents(input: $input) { | ||
agents { | ||
label | ||
createdTimestamp | ||
namespace | ||
} | ||
} | ||
} | ||
""" | ||
|
||
GQL_DELETE_AGENT = """ | ||
mutation deleteAgent($id: ID!) { | ||
deleteAgents( | ||
where: { id: $id } | ||
delete: { | ||
blobEntries: { | ||
where: { node: { parentConnection: {Agent: {node: {id: $id } } } } } | ||
} | ||
} | ||
) { | ||
nodesDeleted | ||
relationshipsDeleted | ||
} | ||
} | ||
""" | ||
|
||
QUERY_LIST_AGENTS = """ | ||
query listAgents($id: ID!) { | ||
orgs(where: {id: $id}) { | ||
agents { | ||
label | ||
} | ||
} | ||
} | ||
""" | ||
|
||
QUERY_GET_AGENT_METADATA = """ | ||
query getAgentMetadata($id: ID!) { | ||
agents(where: {id: $id}) { | ||
metadata | ||
} | ||
} | ||
""" | ||
|
||
QUERY_SET_AGENT_METADATA = """ | ||
mutation setAgentMetadata($id: ID!, $meta: String!) { | ||
updateAgents( | ||
where: { id: $id } | ||
update: { metadata: $meta } | ||
) { | ||
agents { | ||
metadata | ||
} | ||
} | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
[operations] | ||
|
||
QUERY_GET_GRAPH = """ | ||
query getGraph($fgId: ID!) { | ||
factorgraphs (where: {id: $fgId}) { | ||
label | ||
createdTimestamp | ||
namespace | ||
} | ||
} | ||
""" | ||
|
||
MUTATION_ADD_GRAPH = """ | ||
mutation addGraph( | ||
$orgId: ID = "" | ||
$id: ID = "", | ||
$label: String = "", | ||
$description: String = "", | ||
$metadata: String = "", | ||
$_version: String = "", | ||
) { | ||
addFactorgraphs( | ||
input: {id: $id, label: $label, _version: $_version, description: $description, metadata: $metadata, org: {connect: {where: {node: {id: $orgId}}}}} | ||
) { | ||
factorgraphs { | ||
label | ||
createdTimestamp | ||
namespace | ||
} | ||
} | ||
} | ||
""" | ||
|
||
MUTATION_DELETE_GRAPH = """ | ||
mutation deleteGraph($id: ID!) { | ||
deleteFactorgraphs( | ||
where: { id: $id } | ||
delete: { | ||
blobEntries: { | ||
where: { node: { parentConnection: {Factorgraph: {node: {id: $id } } } } } | ||
} | ||
} | ||
) { | ||
nodesDeleted | ||
relationshipsDeleted | ||
} | ||
} | ||
""" | ||
|
||
QUERY_LIST_GRAPHS = """ | ||
query listGraphs($id: ID!) { | ||
orgs(where: {id: $id}) { | ||
fgs { | ||
label | ||
} | ||
} | ||
} | ||
""" | ||
|
||
QUERY_GET_GRAPH_METADATA = """ | ||
query getGraphMetadata($id: ID!) { | ||
factorgraphs(where: {id: $id}) { | ||
metadata | ||
} | ||
} | ||
""" | ||
|
||
MUTATION_SET_GRAPH_METADATA = """ | ||
mutation setGraphMetadata($id: ID!, $meta: String!) { | ||
updateFactorgraphs( | ||
where: { id: $id } | ||
update: { metadata: $meta } | ||
) { | ||
factorgraphs { | ||
metadata | ||
} | ||
} | ||
} | ||
""" | ||
|
||
GQL_CONNECT_GRAPH_TO_MODEL = """ | ||
mutation connectGraphModel($modelId: ID!, $fgId: ID!) { | ||
updateModels( | ||
where: { id: $modelId } | ||
update: { fgs: { connect: { where: { node: { id: $fgId } } } } } | ||
) { | ||
info { | ||
relationshipsCreated | ||
} | ||
} | ||
} | ||
""" | ||
|
||
GQL_CONNECT_GRAPH_TO_AGENT = """ | ||
mutation connectGraphModel($agentId: ID!, $fgId: ID!) { | ||
updateAgents( | ||
where: { id: $agentId } | ||
update: { fgs: { connect: { where: { node: { id: $fgId } } } } } | ||
) { | ||
info { | ||
relationshipsCreated | ||
} | ||
} | ||
} | ||
""" | ||
|
||
QUERY_GET_GRAPHS_AGENTS = """ | ||
query getAgents_Graph($id: ID!) { | ||
factorgraphs(where: {id: $id}) { | ||
agents { | ||
label | ||
namespace | ||
} | ||
} | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[operations] | ||
|
||
GQL_ADD_ORG = """ | ||
mutation addOrg($label: String!, $description: String = "") { | ||
addOrgs(input: {label: $label, description: $description}) { | ||
orgs { | ||
id | ||
label | ||
description | ||
} | ||
} | ||
} | ||
""" | ||
|
||
GQL_GET_ORG = """ | ||
query getOrg($label: String!) { | ||
orgs(where: {label: $label}) { | ||
id | ||
label | ||
description | ||
} | ||
} | ||
""" | ||
|
||
GQL_GET_ORGS = """ | ||
query getOrgs{ | ||
orgs{ | ||
id | ||
label | ||
description | ||
} | ||
} | ||
""" |