Skip to content

Instantly share code, notes, and snippets.

@brendanmckenzie
Created March 26, 2021 22:28
Show Gist options
  • Save brendanmckenzie/2cfa0c332c0b60b740632fbb0a402a2f to your computer and use it in GitHub Desktop.
Save brendanmckenzie/2cfa0c332c0b60b740632fbb0a402a2f to your computer and use it in GitHub Desktop.
mutation {
updateQuote(
input: {
patch: {
quoteDaysUsingId: {
updateById: {
patch: { propertyToPropertyId: { connectById: { id: 1 } } }
id: 1
}
}
}
id: 1
}
) {
quote {
id
quoteDays {
nodes {
id
property {
value
}
}
}
}
}
}
create table quote
(
id int not null primary key
);
create table property
(
id int not null primary key,
value text
);
create table quote_day
(
id int not null primary key,
quote_id int not null references quote (id),
property_id int not null references property (id)
);
insert into property
values (1, 'Property 1');
insert into property
values (2, 'Property 2');
insert into quote
values (1);
insert into quote_day
values (1, 1, 1);
mutation {
updateQuoteDay(input: { id: 1, patch: { propertyId: 1 } }) {
quoteDay {
property {
value
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment