TriPSs / nestjs-query

Easy CRUD for GraphQL.
https://tripss.github.io/nestjs-query/
MIT License
152 stars 43 forks source link

Specified relationName is not honoured for mutations and aggregations #239

Closed coupster74 closed 5 months ago

coupster74 commented 5 months ago

Describe the bug When a relationship name is specified in the definition, in v5.1.0-alpha.1 it appears to be working on the entity results (wasn't in the ^4.0.0 version I was using before). However, aggregate functions are still being pluralized and the relationship name is not being used

Have you read the Contributing Guidelines?

yes

To Reproduce Steps to reproduce the behavior: 1) for a relationship, specify the name, example below:

@FilterableUnPagedRelation('ofInterestTo', () => Company, {
  relationName: 'ofInterestTo',
  nullable: true,
  update: { enabled: true },
  remove: { enabled: true },
})

when you view the fields available, you see aggregate results are not honoring the relationship name: image

nor are the resulting mutations: image

Expected behavior Mutations and aggregate graphql attributes/objects should also adhere to the relationship name specified.

Desktop (please complete the following information):

TriPSs commented 5 months ago

Thanks for reporting, I see I only updated the read relations resolver and not the others.

TriPSs commented 5 months ago

Should be fixed in v5.1.0-alpha.2