Skip to content

Commit 1243ef7

Browse files
kiakingphortx
authored andcommitted
Adopt components name to the new version of Vuex ORM (#36)
* Adopt components name to the new version of Vuex ORM * Update Vuex ORM to 0.25.5
1 parent 1ccdfd7 commit 1243ef7

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@types/graphql": "^0.12.3",
4848
"@types/inflection": "^1.5.28",
4949
"@types/lodash-es": "^4.17.0",
50-
"@vuex-orm/core": "^0.25.4",
50+
"@vuex-orm/core": "^0.25.5",
5151
"apollo-cache-inmemory": "^1.1.7",
5252
"apollo-client": "^2.2.2",
5353
"apollo-link": "^1.2.0",

src/actions/action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Context from '../common/context';
33
import { Store } from '../orm/store';
44
import { Arguments, Data, DispatchFunction } from '../support/interfaces';
55
import Model from '../orm/model';
6-
import State from '@vuex-orm/core/lib/modules/State';
6+
import RootState from '@vuex-orm/core/lib/modules/contracts/RootState';
77
import Transformer from '../graphql/transformer';
88
import NameGenerator from '../graphql/name-generator';
99
import Schema from '../graphql/schema';
@@ -63,10 +63,10 @@ export default class Action {
6363

6464
/**
6565
* Convenience method to get the model from the state.
66-
* @param {State} state Vuex state
66+
* @param {RootState} state Vuex state
6767
* @returns {Model}
6868
*/
69-
protected static getModelFromState (state: State): Model {
69+
protected static getModelFromState (state: RootState): Model {
7070
return Context.getInstance().getModel(state.$name);
7171
}
7272

src/support/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ORMModel from '@vuex-orm/core/lib/model/Model';
22
import Database from '@vuex-orm/core/lib/database/Database';
3-
import State from '@vuex-orm/core/lib/modules/State';
3+
import RootState from '@vuex-orm/core/lib/modules/contracts/RootState';
44
import { ApolloLink } from 'apollo-link';
55

66
export type DispatchFunction = (action: string, data: Data) => Promise<any>;
@@ -22,7 +22,7 @@ export interface ActionParams {
2222
getters: any;
2323
rootGetters: any;
2424
rootState: any;
25-
state: State;
25+
state: RootState;
2626
filter?: Filter;
2727
id?: number;
2828
data?: Data;

src/vuex-orm-graphql.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ export default class VuexORMGraphQL {
2828
private static setupActions () {
2929
const context = Context.getInstance();
3030

31-
context.components.rootActions.simpleQuery = SimpleQuery.call.bind(SimpleQuery);
32-
context.components.rootActions.simpleMutation = SimpleMutation.call.bind(SimpleMutation);
31+
context.components.RootActions.simpleQuery = SimpleQuery.call.bind(SimpleQuery);
32+
context.components.RootActions.simpleMutation = SimpleMutation.call.bind(SimpleMutation);
3333

34-
context.components.subActions.fetch = Fetch.call.bind(Fetch);
35-
context.components.subActions.persist = Persist.call.bind(Persist);
36-
context.components.subActions.push = Push.call.bind(Push);
37-
context.components.subActions.destroy = Destroy.call.bind(Destroy);
38-
context.components.subActions.mutate = Mutate.call.bind(Mutate);
39-
context.components.subActions.query = Query.call.bind(Query);
34+
context.components.Actions.fetch = Fetch.call.bind(Fetch);
35+
context.components.Actions.persist = Persist.call.bind(Persist);
36+
context.components.Actions.push = Push.call.bind(Push);
37+
context.components.Actions.destroy = Destroy.call.bind(Destroy);
38+
context.components.Actions.mutate = Mutate.call.bind(Mutate);
39+
context.components.Actions.query = Query.call.bind(Query);
4040
}
4141

4242
/**

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@
185185
source-map "^0.5.6"
186186
vue-template-es2015-compiler "^1.6.0"
187187

188-
"@vuex-orm/core@^0.25.4":
189-
version "0.25.4"
190-
resolved "https://registry.yarnpkg.com/@vuex-orm/core/-/core-0.25.4.tgz#0609e0df8a2ab2b614d53b8ce25e2c2bd562d0d3"
188+
"@vuex-orm/core@^0.25.5":
189+
version "0.25.5"
190+
resolved "https://registry.yarnpkg.com/@vuex-orm/core/-/core-0.25.5.tgz#ebdcfbbdb19195fff76309c1a8d4c1a708a23b38"
191191

192192
"@webassemblyjs/[email protected]":
193193
version "1.4.3"

0 commit comments

Comments
 (0)