graphql-compose / graphql-compose-mongoose

Mongoose model converter to GraphQL types with resolvers for graphql-compose https://github.com/nodkz/graphql-compose
MIT License
708 stars 94 forks source link

Support RegularExpression for filtering Operators #165

Open chanhohang opened 5 years ago

chanhohang commented 5 years ago

Hi,

I am just wondering if it's possible to support "like" for text fields in _operators when doing filtering?

that will be very useful for my use case.

thanks.

nodkz commented 5 years ago

You may use Resolver.addFilterArg method:

https://github.com/graphql-compose/graphql-compose/issues/22

chanhohang commented 5 years ago

Thanks for your reply and that works.

Though I think it will be very helpful if Regex can be supported out of the box for text fields for the library.

nodkz commented 5 years ago

Pull request welcome ;)

See resolvers folder. It's quite simple.

freitasmurillo commented 5 years ago

I also think this feature will be amazing so...

Pull request in... https://github.com/graphql-compose/graphql-compose-mongoose/pull/174