Open hagabaka opened 1 year ago
I also ran into this issue and I thought I was going crazy because passing the options was doing nothing, but now I see why this is happening.
And actually, I can't track down which is running first, so I'm unable to add any options at all?
I think a workaround is using baseTypeName
, prefix
, and/or suffix
options of FilterHelperArgsOpts
to have different type names for different usages of findMany
. https://github.com/graphql-compose/graphql-compose-mongoose#filterhelperargsopts
When you use a TC's
findMany
resolver multiple times in schema, for example, first to add a relation, then to add afindMany
query, and then to add apagination
query:Then
xFindMany
andxPaginate
queries will usefilterOptions1
, but notfilterOptions2
orfilterOptions3
.It seems that by default the generated filter input type for all the
findMany
resolvers of the same model share the same name, so the type is created for the firstfindMany
, and reused for all other ones. If this default behavior can't be changed, it would be nice to at least have a run time warning and/or FAQ entry in documentation about the limitation.