TriPSs / nestjs-query

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

Option to disable pluralization of relation name #217

Closed selvinkuik closed 10 months ago

selvinkuik commented 10 months ago

When implementing a @FilterableUnPagedRelation as documented here...

https://tripss.github.io/nestjs-query/docs/graphql/relations#filterableunpagedrelation

If you were to use the line...

@FilterableUnPagedRelation('contentSent', () => SubTaskDTO, { update: { enabled: true } })

The name is automatically pluralized, meaning the GQL query looks like this...

{
  parent {
    contentSents {
      ...
    }
  }
}

Requesting an option to be able to disable pluralization

TriPSs commented 10 months ago

Interesting, there is indeed something to say to never pluralize that name since if the name does not match the relation there already is an option to overwrite that (relationName option).

In your case here does that also mean that the relation is not working since you have it on your entity as contentSent to?

TriPSs commented 10 months ago

It's also bit weird that it does respect that name in the filters but than outputs it different in the query.