Skip to content

Commit af4a508

Browse files
committed
Release RC 11
1 parent 536bcc1 commit af4a508

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

dist/vuex-orm-graphql.esm.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28178,9 +28178,7 @@ var QueryBuilder = /** @class */ (function () {
2817828178
var value = args[key];
2817928179
var isForeignKey = model.skipField(key);
2818028180
var skipFieldDueId = (key === 'id' || isForeignKey) && !allowIdFields;
28181-
var schema = Context.getInstance().schema;
28182-
var type = schema.getType(model.singularName + (filter ? 'Filter' : ''));
28183-
var schemaField = type ? (filter ? type.inputFields : type.fields).find(function (f) { return f.name === key; }) : null;
28181+
var schemaField = _this.findSchemaFieldForArgument(key, field, model, filter);
2818428182
var isConnectionField = schemaField && Schema.getTypeNameOfField(schemaField).endsWith('TypeConnection');
2818528183
// Ignore null fields, ids and connections
2818628184
if (value && !skipFieldDueId && !isConnectionField) {
@@ -28262,6 +28260,23 @@ var QueryBuilder = /** @class */ (function () {
2826228260
}
2826328261
}
2826428262
};
28263+
QueryBuilder.findSchemaFieldForArgument = function (name, field, model, isFilter) {
28264+
var schema = Context.getInstance().schema;
28265+
var schemaField;
28266+
if (field) {
28267+
schemaField = field.args.find(function (f) { return f.name === name; });
28268+
if (!schemaField) {
28269+
Context.getInstance().logger.warn("Could find the argument with name " + name + " for the mutation/query " + field.name);
28270+
}
28271+
}
28272+
else {
28273+
// We try to find the FilterType or at least the Type this query belongs to.
28274+
var type = schema.getType(model.singularName + (isFilter ? 'Filter' : ''));
28275+
// Next we try to find the field from the type
28276+
schemaField = type ? (isFilter ? type.inputFields : type.fields).find(function (f) { return f.name === name; }) : undefined;
28277+
}
28278+
return schemaField;
28279+
};
2826528280
/**
2826628281
* Generates the fields for all related models.
2826728282
*

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vuex-orm/plugin-graphql",
3-
"version": "1.0.0-rc.11",
3+
"version": "1.0.0-rc.12",
44
"description": "Vuex-ORM Plugin to sync the data against a GraphQL API.",
55
"main": "dist/vuex-orm-graphql.common.js",
66
"module": "dist/vuex-orm-graphql.esm.js",

0 commit comments

Comments
 (0)