mirror of
https://github.com/strapi/strapi.git
synced 2025-08-18 05:37:10 +00:00
Merge pull request #3416 from strapi/fix/custom-graphql-query
Fix primaryKey not found for custom resolvers
This commit is contained in:
commit
e79e110add
@ -286,14 +286,17 @@ module.exports = {
|
|||||||
Object.defineProperties(ctx, {
|
Object.defineProperties(ctx, {
|
||||||
query: {
|
query: {
|
||||||
value: {
|
value: {
|
||||||
...this.convertToParams(_.omit(opts, 'where'), model.primaryKey),
|
...this.convertToParams(
|
||||||
|
_.omit(opts, 'where'),
|
||||||
|
model ? model.primaryKey : 'id'
|
||||||
|
),
|
||||||
...this.convertToQuery(opts.where),
|
...this.convertToQuery(opts.where),
|
||||||
},
|
},
|
||||||
writable: true,
|
writable: true,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
value: this.convertToParams(opts, model.primaryKey),
|
value: this.convertToParams(opts, model ? model.primaryKey : 'id'),
|
||||||
writable: true,
|
writable: true,
|
||||||
configurable: true,
|
configurable: true,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user