@ -24,7 +24,9 @@ export class DeleteManyQueryFactory {
|
||||
mutation {
|
||||
deleteFrom${
|
||||
options.targetTableName
|
||||
}Collection(filter: ${stringifyWithoutKeyQuote(args.filter)}, atMost: 30) {
|
||||
}Collection(filter: ${stringifyWithoutKeyQuote(
|
||||
args.filter,
|
||||
)}, atMost: 30) {
|
||||
affectedCount
|
||||
records {
|
||||
${fieldsString}
|
||||
|
||||
@ -35,10 +35,15 @@ export class UpdateManyQueryFactory {
|
||||
options.fieldMetadataCollection,
|
||||
);
|
||||
|
||||
const argsData = {
|
||||
...computedArgs.data,
|
||||
updatedAt: new Date().toISOString(),
|
||||
};
|
||||
|
||||
return `
|
||||
mutation {
|
||||
update${options.targetTableName}Collection(
|
||||
set: ${stringifyWithoutKeyQuote(computedArgs.data)},
|
||||
set: ${stringifyWithoutKeyQuote(argsData)},
|
||||
filter: ${stringifyWithoutKeyQuote(args.filter)},
|
||||
) {
|
||||
affectedCount
|
||||
|
||||
@ -31,12 +31,17 @@ export class UpdateOneQueryFactory {
|
||||
options.fieldMetadataCollection,
|
||||
);
|
||||
|
||||
const argsData = {
|
||||
...computedArgs.data,
|
||||
updatedAt: new Date().toISOString(),
|
||||
};
|
||||
|
||||
return `
|
||||
mutation {
|
||||
update${
|
||||
options.targetTableName
|
||||
}Collection(set: ${stringifyWithoutKeyQuote(
|
||||
computedArgs.data,
|
||||
argsData,
|
||||
)}, filter: { id: { eq: "${computedArgs.id}" } }) {
|
||||
affectedCount
|
||||
records {
|
||||
|
||||
Reference in New Issue
Block a user