Skip to content

Commit 68fe20f

Browse files
committed
chore: linting
1 parent 01a927f commit 68fe20f

9 files changed

+94
-63
lines changed

dist/vuex-orm-graphql.cjs.js

+36-26
Original file line numberDiff line numberDiff line change
@@ -14297,7 +14297,7 @@ var Transformer = /** @class */ (function () {
1429714297
var inputType = Context.getInstance().schema.getType(inputTypeName, false);
1429814298
if (inputType === null)
1429914299
throw new Error("Type " + inputType + " doesn't exist.");
14300-
return inputType.inputFields.find(function (f) { return f.name === fieldName; }) != null;
14300+
return inputType.inputFields.find(function (f) { return f.name === fieldName; }) !== undefined;
1430114301
};
1430214302
/**
1430314303
* Registers a record for recursion detection.
@@ -15148,8 +15148,9 @@ var QueryBuilder = /** @class */ (function () {
1514815148
if (!first) {
1514915149
if (!signature &&
1515015150
filter &&
15151-
Context.getInstance().adapter.getArgumentMode() === exports.ArgumentMode.TYPE)
15151+
Context.getInstance().adapter.getArgumentMode() === exports.ArgumentMode.TYPE) {
1515215152
returnValue = "filter: { " + returnValue + " }";
15153+
}
1515315154
returnValue = "(" + returnValue + ")";
1515415155
}
1515515156
}
@@ -15633,7 +15634,7 @@ var Mutate = /** @class */ (function (_super) {
1563315634
var state = _a.state, dispatch = _a.dispatch;
1563415635
var args = _b.args, name = _b.name;
1563515636
return __awaiter(this, void 0, void 0, function () {
15636-
var context, model, mockReturnValue, schema;
15637+
var context, model, mockReturnValue;
1563715638
return __generator(this, function (_c) {
1563815639
switch (_c.label) {
1563915640
case 0:
@@ -15649,7 +15650,7 @@ var Mutate = /** @class */ (function (_super) {
1564915650
}
1565015651
return [4 /*yield*/, context.loadSchema()];
1565115652
case 1:
15652-
schema = _c.sent();
15653+
_c.sent();
1565315654
args = this.prepareArgs(args);
1565415655
// There could be anything in the args, but we have to be sure that all records are gone through
1565515656
// transformOutgoingData()
@@ -15703,7 +15704,7 @@ var Persist = /** @class */ (function (_super) {
1570315704
return __generator(this, function (_c) {
1570415705
switch (_c.label) {
1570515706
case 0:
15706-
if (!id) return [3 /*break*/, 6];
15707+
if (!id) return [3 /*break*/, 7];
1570715708
model = this.getModelFromState(state);
1570815709
mutationName = Context.getInstance().adapter.getNameForPersist(model);
1570915710
oldRecord = model.getRecordWithId(id);
@@ -15719,20 +15720,24 @@ var Persist = /** @class */ (function (_super) {
1571915720
case 2:
1572015721
_c.sent();
1572115722
return [2 /*return*/, newRecord_1];
15722-
case 3:
15723+
case 3:
15724+
// Arguments
15725+
return [4 /*yield*/, Context.getInstance().loadSchema()];
15726+
case 4:
1572315727
// Arguments
15728+
_c.sent();
1572415729
args = this.prepareArgs(args);
1572515730
this.addRecordToArgs(args, model, oldRecord);
1572615731
return [4 /*yield*/, Action.mutation(mutationName, args, dispatch, model)];
15727-
case 4:
15732+
case 5:
1572815733
newRecord = _c.sent();
1572915734
// Delete the old record if necessary
1573015735
return [4 /*yield*/, this.deleteObsoleteRecord(model, newRecord, oldRecord)];
15731-
case 5:
15736+
case 6:
1573215737
// Delete the old record if necessary
1573315738
_c.sent();
1573415739
return [2 /*return*/, newRecord];
15735-
case 6:
15740+
case 7:
1573615741
/* istanbul ignore next */
1573715742
throw new Error("The persist action requires the 'id' to be set");
1573815743
}
@@ -15797,23 +15802,28 @@ var Push = /** @class */ (function (_super) {
1579715802
return __awaiter(this, void 0, void 0, function () {
1579815803
var model, mutationName, mockReturnValue;
1579915804
return __generator(this, function (_c) {
15800-
if (data) {
15801-
model = this.getModelFromState(state);
15802-
mutationName = Context.getInstance().adapter.getNameForPush(model);
15803-
mockReturnValue = model.$mockHook("push", {
15804-
data: data,
15805-
args: args || {}
15806-
});
15807-
if (mockReturnValue) {
15808-
return [2 /*return*/, Store.insertData(mockReturnValue, dispatch)];
15809-
}
15810-
// Arguments
15811-
args = this.prepareArgs(args, data.id);
15812-
this.addRecordToArgs(args, model, data);
15813-
// Send the mutation
15814-
return [2 /*return*/, Action.mutation(mutationName, args, dispatch, model)];
15815-
}
15816-
else {
15805+
switch (_c.label) {
15806+
case 0:
15807+
if (!data) return [3 /*break*/, 2];
15808+
model = this.getModelFromState(state);
15809+
mutationName = Context.getInstance().adapter.getNameForPush(model);
15810+
mockReturnValue = model.$mockHook("push", {
15811+
data: data,
15812+
args: args || {}
15813+
});
15814+
if (mockReturnValue) {
15815+
return [2 /*return*/, Store.insertData(mockReturnValue, dispatch)];
15816+
}
15817+
// Arguments
15818+
return [4 /*yield*/, Context.getInstance().loadSchema()];
15819+
case 1:
15820+
// Arguments
15821+
_c.sent();
15822+
args = this.prepareArgs(args, data.id);
15823+
this.addRecordToArgs(args, model, data);
15824+
// Send the mutation
15825+
return [2 /*return*/, Action.mutation(mutationName, args, dispatch, model)];
15826+
case 2:
1581715827
/* istanbul ignore next */
1581815828
throw new Error("The persist action requires the 'data' to be set");
1581915829
}

dist/vuex-orm-graphql.esm-bundler.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -14271,7 +14271,7 @@ class Transformer {
1427114271
const inputType = Context.getInstance().schema.getType(inputTypeName, false);
1427214272
if (inputType === null)
1427314273
throw new Error(`Type ${inputType} doesn't exist.`);
14274-
return inputType.inputFields.find(f => f.name === fieldName) != null;
14274+
return inputType.inputFields.find(f => f.name === fieldName) !== undefined;
1427514275
}
1427614276
/**
1427714277
* Registers a record for recursion detection.
@@ -15161,8 +15161,9 @@ class QueryBuilder {
1516115161
if (!first) {
1516215162
if (!signature &&
1516315163
filter &&
15164-
Context.getInstance().adapter.getArgumentMode() === ArgumentMode.TYPE)
15164+
Context.getInstance().adapter.getArgumentMode() === ArgumentMode.TYPE) {
1516515165
returnValue = `filter: { ${returnValue} }`;
15166+
}
1516615167
returnValue = `(${returnValue})`;
1516715168
}
1516815169
}
@@ -15550,7 +15551,7 @@ class Mutate extends Action {
1555015551
if (mockReturnValue) {
1555115552
return Store.insertData(mockReturnValue, dispatch);
1555215553
}
15553-
const schema = await context.loadSchema();
15554+
await context.loadSchema();
1555415555
args = this.prepareArgs(args);
1555515556
// There could be anything in the args, but we have to be sure that all records are gone through
1555615557
// transformOutgoingData()
@@ -15601,6 +15602,7 @@ class Persist extends Action {
1560115602
return newRecord;
1560215603
}
1560315604
// Arguments
15605+
await Context.getInstance().loadSchema();
1560415606
args = this.prepareArgs(args);
1560515607
this.addRecordToArgs(args, model, oldRecord);
1560615608
// Send mutation
@@ -15665,6 +15667,7 @@ class Push extends Action {
1566515667
return Store.insertData(mockReturnValue, dispatch);
1566615668
}
1566715669
// Arguments
15670+
await Context.getInstance().loadSchema();
1566815671
args = this.prepareArgs(args, data.id);
1566915672
this.addRecordToArgs(args, model, data);
1567015673
// Send the mutation

dist/vuex-orm-graphql.esm.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -14271,7 +14271,7 @@ class Transformer {
1427114271
const inputType = Context.getInstance().schema.getType(inputTypeName, false);
1427214272
if (inputType === null)
1427314273
throw new Error(`Type ${inputType} doesn't exist.`);
14274-
return inputType.inputFields.find(f => f.name === fieldName) != null;
14274+
return inputType.inputFields.find(f => f.name === fieldName) !== undefined;
1427514275
}
1427614276
/**
1427714277
* Registers a record for recursion detection.
@@ -15161,8 +15161,9 @@ class QueryBuilder {
1516115161
if (!first) {
1516215162
if (!signature &&
1516315163
filter &&
15164-
Context.getInstance().adapter.getArgumentMode() === ArgumentMode.TYPE)
15164+
Context.getInstance().adapter.getArgumentMode() === ArgumentMode.TYPE) {
1516515165
returnValue = `filter: { ${returnValue} }`;
15166+
}
1516615167
returnValue = `(${returnValue})`;
1516715168
}
1516815169
}
@@ -15550,7 +15551,7 @@ class Mutate extends Action {
1555015551
if (mockReturnValue) {
1555115552
return Store.insertData(mockReturnValue, dispatch);
1555215553
}
15553-
const schema = await context.loadSchema();
15554+
await context.loadSchema();
1555415555
args = this.prepareArgs(args);
1555515556
// There could be anything in the args, but we have to be sure that all records are gone through
1555615557
// transformOutgoingData()
@@ -15601,6 +15602,7 @@ class Persist extends Action {
1560115602
return newRecord;
1560215603
}
1560315604
// Arguments
15605+
await Context.getInstance().loadSchema();
1560415606
args = this.prepareArgs(args);
1560515607
this.addRecordToArgs(args, model, oldRecord);
1560615608
// Send mutation
@@ -15665,6 +15667,7 @@ class Push extends Action {
1566515667
return Store.insertData(mockReturnValue, dispatch);
1566615668
}
1566715669
// Arguments
15670+
await Context.getInstance().loadSchema();
1566815671
args = this.prepareArgs(args, data.id);
1566915672
this.addRecordToArgs(args, model, data);
1567015673
// Send the mutation

dist/vuex-orm-graphql.esm.prod.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -14271,7 +14271,7 @@ class Transformer {
1427114271
const inputType = Context.getInstance().schema.getType(inputTypeName, false);
1427214272
if (inputType === null)
1427314273
throw new Error(`Type ${inputType} doesn't exist.`);
14274-
return inputType.inputFields.find(f => f.name === fieldName) != null;
14274+
return inputType.inputFields.find(f => f.name === fieldName) !== undefined;
1427514275
}
1427614276
/**
1427714277
* Registers a record for recursion detection.
@@ -15161,8 +15161,9 @@ class QueryBuilder {
1516115161
if (!first) {
1516215162
if (!signature &&
1516315163
filter &&
15164-
Context.getInstance().adapter.getArgumentMode() === ArgumentMode.TYPE)
15164+
Context.getInstance().adapter.getArgumentMode() === ArgumentMode.TYPE) {
1516515165
returnValue = `filter: { ${returnValue} }`;
15166+
}
1516615167
returnValue = `(${returnValue})`;
1516715168
}
1516815169
}
@@ -15550,7 +15551,7 @@ class Mutate extends Action {
1555015551
if (mockReturnValue) {
1555115552
return Store.insertData(mockReturnValue, dispatch);
1555215553
}
15553-
const schema = await context.loadSchema();
15554+
await context.loadSchema();
1555415555
args = this.prepareArgs(args);
1555515556
// There could be anything in the args, but we have to be sure that all records are gone through
1555615557
// transformOutgoingData()
@@ -15601,6 +15602,7 @@ class Persist extends Action {
1560115602
return newRecord;
1560215603
}
1560315604
// Arguments
15605+
await Context.getInstance().loadSchema();
1560415606
args = this.prepareArgs(args);
1560515607
this.addRecordToArgs(args, model, oldRecord);
1560615608
// Send mutation
@@ -15665,6 +15667,7 @@ class Push extends Action {
1566515667
return Store.insertData(mockReturnValue, dispatch);
1566615668
}
1566715669
// Arguments
15670+
await Context.getInstance().loadSchema();
1566815671
args = this.prepareArgs(args, data.id);
1566915672
this.addRecordToArgs(args, model, data);
1567015673
// Send the mutation

dist/vuex-orm-graphql.global.js

+36-26
Original file line numberDiff line numberDiff line change
@@ -14296,7 +14296,7 @@ var VuexORMGraphQLPlugin = (function (exports) {
1429614296
var inputType = Context.getInstance().schema.getType(inputTypeName, false);
1429714297
if (inputType === null)
1429814298
throw new Error("Type " + inputType + " doesn't exist.");
14299-
return inputType.inputFields.find(function (f) { return f.name === fieldName; }) != null;
14299+
return inputType.inputFields.find(function (f) { return f.name === fieldName; }) !== undefined;
1430014300
};
1430114301
/**
1430214302
* Registers a record for recursion detection.
@@ -15147,8 +15147,9 @@ var VuexORMGraphQLPlugin = (function (exports) {
1514715147
if (!first) {
1514815148
if (!signature &&
1514915149
filter &&
15150-
Context.getInstance().adapter.getArgumentMode() === exports.ArgumentMode.TYPE)
15150+
Context.getInstance().adapter.getArgumentMode() === exports.ArgumentMode.TYPE) {
1515115151
returnValue = "filter: { " + returnValue + " }";
15152+
}
1515215153
returnValue = "(" + returnValue + ")";
1515315154
}
1515415155
}
@@ -15632,7 +15633,7 @@ var VuexORMGraphQLPlugin = (function (exports) {
1563215633
var state = _a.state, dispatch = _a.dispatch;
1563315634
var args = _b.args, name = _b.name;
1563415635
return __awaiter(this, void 0, void 0, function () {
15635-
var context, model, mockReturnValue, schema;
15636+
var context, model, mockReturnValue;
1563615637
return __generator(this, function (_c) {
1563715638
switch (_c.label) {
1563815639
case 0:
@@ -15648,7 +15649,7 @@ var VuexORMGraphQLPlugin = (function (exports) {
1564815649
}
1564915650
return [4 /*yield*/, context.loadSchema()];
1565015651
case 1:
15651-
schema = _c.sent();
15652+
_c.sent();
1565215653
args = this.prepareArgs(args);
1565315654
// There could be anything in the args, but we have to be sure that all records are gone through
1565415655
// transformOutgoingData()
@@ -15702,7 +15703,7 @@ var VuexORMGraphQLPlugin = (function (exports) {
1570215703
return __generator(this, function (_c) {
1570315704
switch (_c.label) {
1570415705
case 0:
15705-
if (!id) return [3 /*break*/, 6];
15706+
if (!id) return [3 /*break*/, 7];
1570615707
model = this.getModelFromState(state);
1570715708
mutationName = Context.getInstance().adapter.getNameForPersist(model);
1570815709
oldRecord = model.getRecordWithId(id);
@@ -15718,20 +15719,24 @@ var VuexORMGraphQLPlugin = (function (exports) {
1571815719
case 2:
1571915720
_c.sent();
1572015721
return [2 /*return*/, newRecord_1];
15721-
case 3:
15722+
case 3:
15723+
// Arguments
15724+
return [4 /*yield*/, Context.getInstance().loadSchema()];
15725+
case 4:
1572215726
// Arguments
15727+
_c.sent();
1572315728
args = this.prepareArgs(args);
1572415729
this.addRecordToArgs(args, model, oldRecord);
1572515730
return [4 /*yield*/, Action.mutation(mutationName, args, dispatch, model)];
15726-
case 4:
15731+
case 5:
1572715732
newRecord = _c.sent();
1572815733
// Delete the old record if necessary
1572915734
return [4 /*yield*/, this.deleteObsoleteRecord(model, newRecord, oldRecord)];
15730-
case 5:
15735+
case 6:
1573115736
// Delete the old record if necessary
1573215737
_c.sent();
1573315738
return [2 /*return*/, newRecord];
15734-
case 6:
15739+
case 7:
1573515740
/* istanbul ignore next */
1573615741
throw new Error("The persist action requires the 'id' to be set");
1573715742
}
@@ -15796,23 +15801,28 @@ var VuexORMGraphQLPlugin = (function (exports) {
1579615801
return __awaiter(this, void 0, void 0, function () {
1579715802
var model, mutationName, mockReturnValue;
1579815803
return __generator(this, function (_c) {
15799-
if (data) {
15800-
model = this.getModelFromState(state);
15801-
mutationName = Context.getInstance().adapter.getNameForPush(model);
15802-
mockReturnValue = model.$mockHook("push", {
15803-
data: data,
15804-
args: args || {}
15805-
});
15806-
if (mockReturnValue) {
15807-
return [2 /*return*/, Store.insertData(mockReturnValue, dispatch)];
15808-
}
15809-
// Arguments
15810-
args = this.prepareArgs(args, data.id);
15811-
this.addRecordToArgs(args, model, data);
15812-
// Send the mutation
15813-
return [2 /*return*/, Action.mutation(mutationName, args, dispatch, model)];
15814-
}
15815-
else {
15804+
switch (_c.label) {
15805+
case 0:
15806+
if (!data) return [3 /*break*/, 2];
15807+
model = this.getModelFromState(state);
15808+
mutationName = Context.getInstance().adapter.getNameForPush(model);
15809+
mockReturnValue = model.$mockHook("push", {
15810+
data: data,
15811+
args: args || {}
15812+
});
15813+
if (mockReturnValue) {
15814+
return [2 /*return*/, Store.insertData(mockReturnValue, dispatch)];
15815+
}
15816+
// Arguments
15817+
return [4 /*yield*/, Context.getInstance().loadSchema()];
15818+
case 1:
15819+
// Arguments
15820+
_c.sent();
15821+
args = this.prepareArgs(args, data.id);
15822+
this.addRecordToArgs(args, model, data);
15823+
// Send the mutation
15824+
return [2 /*return*/, Action.mutation(mutationName, args, dispatch, model)];
15825+
case 2:
1581615826
/* istanbul ignore next */
1581715827
throw new Error("The persist action requires the 'data' to be set");
1581815828
}

dist/vuex-orm-graphql.global.prod.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/mutate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class Mutate extends Action {
5656
return Store.insertData(mockReturnValue, dispatch!);
5757
}
5858

59-
const schema: Schema = await context.loadSchema();
59+
await context.loadSchema();
6060
args = this.prepareArgs(args);
6161

6262
// There could be anything in the args, but we have to be sure that all records are gone through

0 commit comments

Comments
 (0)