perch-query-builder icon indicating copy to clipboard operation
perch-query-builder copied to clipboard

Usage for mutation

Open kosheeta opened this issue 4 years ago • 7 comments

Describe the bug My code is:

image image

In console I'm getting an error: image image

In query it's working perfectly.

kosheeta avatar Oct 27 '21 18:10 kosheeta

I'll look into the issue as soon as I can.

Question though, why are you using PerchQueryBuilder for this at all if you are going to append

.select()
.where({ id: family.id })
.getOne()

to the query? You are removing all previous selections and joins made by perch and rendering any where clauses added by the package completely useless. If that is all that you need from the resolver then this package isn't necessary

wesleyyoung avatar Oct 27 '21 18:10 wesleyyoung

If your desire is to force the query into selection of a single record, try appending

.andWhere({ id: family.id })
.getOne()

wesleyyoung avatar Oct 27 '21 18:10 wesleyyoung

If your desire is to force the query into selection of a single record, try appending

.andWhere({ id: family.id })
.getOne()

Not working :(

return PerchQueryBuilder.generateQueryBuilder<Family>(
  this.familiesRepository,
  info
)
  .andWhere({ id: family.id })
  .getOne();

image

kosheeta avatar Oct 31 '21 10:10 kosheeta

Fixed in PR #17

wesleyyoung avatar Oct 31 '21 15:10 wesleyyoung

Same in version 1.3.2

kosheeta avatar Nov 04 '21 13:11 kosheeta

@wesleyyoung reopen please

kosheeta avatar Nov 09 '21 07:11 kosheeta

@wesleyyoung hi, I don't know is it only me or not, but because of that PR, the pagination & sorting do not work anymore Im using PerchQueryBuilder.find()

confirmed: I tried to comment it out, and it worked

gaghan430 avatar Feb 13 '22 03:02 gaghan430