-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
testTest new / existing featureTest new / existing feature
Milestone
Description
- use case 1: initially auto-create many owners for performance testing
insert mutation:
mutation addOwners($owners:[owner_insert_input!]!) {
insert_owner(
objects: $owners
) {
returning {
id
}
}
}Variables:
{
"owners": [
{
"name": "5",
"recert_interval": 365,
"dn":"x",
"group_dn":"x",
"app_id_external": "app-5",
"owner_networks": {"data": [{"ip": "10.5.0.0/16"},{"ip": "10.9.0.0/16"}]}
},
{
"name": "6",
"recert_interval": 30,
"dn":"x",
"group_dn":"x",
"app_id_external": "app-6",
"owner_networks": {"data": [{"ip": "10.6.0.0/16"}]}
},
{
"name": "7",
"recert_interval": 90,
"dn":"x",
"group_dn":"x",
"app_id_external": "app-7",
"owner_networks": {"data": [{"ip": "10.7.0.0/16"}]}
}
]
}- add upsert mutation which does not re-add existing owners or their networks (see https://hasura.io/docs/latest/mutations/postgres/upsert/)
mutation addSingleOwner {
insert_owner(
objects: [
{
name: "sechs"
recert_interval: 222
dn: "a"
group_dn: "b"
app_id_external: "app-sechs"
owner_networks: {
data: [{ ip: "10.69.0.0/16" }, { ip: "10.9.0.0/16" }]
on_conflict: {
constraint: owner_network_ip_unique
update_columns: [ip]
}
}
}
]
on_conflict: {
constraint: owner_name_key
update_columns: [recert_interval, dn, group_dn]
}
) {
returning {
id
}
}
}- problem with checking multiple constraints (seeh ttps://github.com/Handle multiple constraint violations on upsert hasura/graphql-engine#4163)
Metadata
Metadata
Assignees
Labels
testTest new / existing featureTest new / existing feature
Type
Projects
Status
📋 Backlog