@@ -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