Skip to content

Commit ecfa94e

Browse files
committed
Fix build warnings
1 parent 91fe54f commit ecfa94e

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

src/support/interfaces.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,28 @@ export class PatchedModel extends ORMModel {
8989
static async customQuery(params: ActionParams): Promise<any> {
9090
return undefined;
9191
}
92+
93+
async $mutate(params: ActionParams): Promise<any> {
94+
return undefined;
95+
}
96+
97+
async $customQuery(params: ActionParams): Promise<any> {
98+
return undefined;
99+
}
100+
101+
async $persist(args: any): Promise<any> {
102+
return undefined;
103+
}
104+
105+
async $push(args: any): Promise<any> {
106+
return undefined;
107+
}
108+
109+
async $destroy(): Promise<any> {
110+
return undefined;
111+
}
112+
113+
async $deleteAndDestroy(): Promise<any> {
114+
return undefined;
115+
}
92116
}

src/vuex-orm-graphql.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,30 +81,30 @@ export default class VuexORMGraphQL {
8181
};
8282

8383
// Register model convenience methods
84-
const model = context.components.Model.prototype;
84+
const model: PatchedModel = context.components.Model.prototype as PatchedModel;
8585

8686
model.$mutate = async function({ name, args, multiple }: ActionParams) {
8787
args = args || {};
88-
if (!args["id"]) args["id"] = this.id;
88+
if (!args["id"]) args["id"] = this.$id;
8989
return this.$dispatch("mutate", { name, args, multiple });
9090
};
9191

9292
model.$customQuery = async function({ name, filter, multiple, bypassCache }: ActionParams) {
9393
filter = filter || {};
94-
if (!filter["id"]) filter["id"] = this.id;
94+
if (!filter["id"]) filter["id"] = this.$id;
9595
return this.$dispatch("query", { name, filter, multiple, bypassCache });
9696
};
9797

9898
model.$persist = async function(args: any) {
99-
return this.$dispatch("persist", { id: this.id, args });
99+
return this.$dispatch("persist", { id: this.$id, args });
100100
};
101101

102102
model.$push = async function(args: any) {
103103
return this.$dispatch("push", { data: this, args });
104104
};
105105

106106
model.$destroy = async function() {
107-
return this.$dispatch("destroy", { id: this.id });
107+
return this.$dispatch("destroy", { id: this.$id });
108108
};
109109

110110
model.$deleteAndDestroy = async function() {

0 commit comments

Comments
 (0)