Skip to content

Commit 16425f8

Browse files
committed
Fix for SSR
1 parent 8eb0621 commit 16425f8

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
lines changed

dist/vuex-orm-graphql.es5.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuex-orm-graphql.es5.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuex-orm-graphql.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vuex-orm-graphql.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/support/utils.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@ export function graphQlDocumentToString(query: DocumentNode): string {
6969
*/
7070
export function isPlainObject(obj: any): boolean {
7171
// Basic check for Type object that's not null
72-
if (typeof obj === "object" && obj !== null) {
73-
const proto = Object.getPrototypeOf(obj);
74-
return proto === Object.prototype || proto === null;
75-
}
76-
77-
// Not an object
78-
return false;
72+
return obj !== null && typeof obj === "object";
7973
}
8074

8175
/**

src/vuex-orm-graphql.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ export default class VuexORMGraphQL {
5959
bypassCache = false
6060
) {
6161
let filterObj = filter;
62-
if (!isPlainObject(filterObj)) filterObj = { id: filter };
62+
if (!isPlainObject(filterObj)) {
63+
filterObj = { id: filter };
64+
}
6365
return this.dispatch("fetch", { filter: filterObj, bypassCache });
6466
};
6567

0 commit comments

Comments
 (0)