TriPSs/nestjs-query

Option to disable pluralization of relation name

Closed this issue · 2 comments

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

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?

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