@ctil/gql 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -249,6 +249,7 @@ interface MutationInput {
249
249
  _set?: Record<string, any>[];
250
250
  where?: WhereInput;
251
251
  variables?: Record<string, any>;
252
+ variableName?: string;
252
253
  }
253
254
  interface InsertOneInput {
254
255
  operationName: string;
package/dist/index.d.ts CHANGED
@@ -249,6 +249,7 @@ interface MutationInput {
249
249
  _set?: Record<string, any>[];
250
250
  where?: WhereInput;
251
251
  variables?: Record<string, any>;
252
+ variableName?: string;
252
253
  }
253
254
  interface InsertOneInput {
254
255
  operationName: string;
package/dist/index.js CHANGED
@@ -1153,7 +1153,7 @@ function buildGraphQLQueryAggregate(input) {
1153
1153
 
1154
1154
  // src/builders/mutation.ts
1155
1155
  function buildGraphQLMutation(input) {
1156
- const { operationName, fields, datas, _set, where, variables } = input;
1156
+ const { operationName, fields, datas, _set, where, variables, variableName } = input;
1157
1157
  if (!operationName) {
1158
1158
  throw new Error("operationName is required");
1159
1159
  }
@@ -1168,7 +1168,7 @@ function buildGraphQLMutation(input) {
1168
1168
  finalVariables.datas = dataArray;
1169
1169
  const datasArg = "$datas";
1170
1170
  const query2 = `mutation ${operationName}${varDefs ? `(${varDefs})` : ""} {
1171
- ${operationName}(${operationName}: ${datasArg}) {
1171
+ ${operationName}(${variableName ? variableName : "datas"}: ${datasArg}) {
1172
1172
  affected_rows
1173
1173
  returning { ${fieldsStr} }
1174
1174
  }