@@ -81,30 +81,30 @@ export default class VuexORMGraphQL {
81
81
} ;
82
82
83
83
// Register model convenience methods
84
- const model = context . components . Model . prototype ;
84
+ const model : PatchedModel = context . components . Model . prototype as PatchedModel ;
85
85
86
86
model . $mutate = async function ( { name, args, multiple } : ActionParams ) {
87
87
args = args || { } ;
88
- if ( ! args [ "id" ] ) args [ "id" ] = this . id ;
88
+ if ( ! args [ "id" ] ) args [ "id" ] = this . $ id;
89
89
return this . $dispatch ( "mutate" , { name, args, multiple } ) ;
90
90
} ;
91
91
92
92
model . $customQuery = async function ( { name, filter, multiple, bypassCache } : ActionParams ) {
93
93
filter = filter || { } ;
94
- if ( ! filter [ "id" ] ) filter [ "id" ] = this . id ;
94
+ if ( ! filter [ "id" ] ) filter [ "id" ] = this . $ id;
95
95
return this . $dispatch ( "query" , { name, filter, multiple, bypassCache } ) ;
96
96
} ;
97
97
98
98
model . $persist = async function ( args : any ) {
99
- return this . $dispatch ( "persist" , { id : this . id , args } ) ;
99
+ return this . $dispatch ( "persist" , { id : this . $ id, args } ) ;
100
100
} ;
101
101
102
102
model . $push = async function ( args : any ) {
103
103
return this . $dispatch ( "push" , { data : this , args } ) ;
104
104
} ;
105
105
106
106
model . $destroy = async function ( ) {
107
- return this . $dispatch ( "destroy" , { id : this . id } ) ;
107
+ return this . $dispatch ( "destroy" , { id : this . $ id } ) ;
108
108
} ;
109
109
110
110
model . $deleteAndDestroy = async function ( ) {
0 commit comments