vuex-orm / plugin-graphql

Vuex ORM persistence plugin to sync the store against a GraphQL API.

Home Page:https://vuex-orm.github.io/plugin-graphql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Forcing upcase on model name in buildQuery overwites value set by adapter

freakent opened this issue · comments

In source file plugin-graphql/blob/master/src/graphql/query-builder.ts, function name buildQuery(...). I don't think this uppcaseFirstLetter(name) should be used here. It appears to be changing a value set by a custom adapter.

// build query const query: string = \${type} ${upcaseFirstLetter(name)}${this.buildArguments(
model,
args,
true,
filter,
true,
field
)} {\n` +
` ${this.buildField(model, multiple, args, [], name, filter, true)}\n` +
};
`

Impacts using a custom adapter to set the name of a mutation with getNameforPersit(model).