kontist / type-graphql-filter Goto Github PK
View Code? Open in Web Editor NEWFilter decorator for type-graphql
License: Other
Filter decorator for type-graphql
License: Other
I was trying to create a filter on a Enum field and ts was not happy.
Took a look at your types, and here you have way less possible types than the type-graphql types do.
type-graphql has
export declare type TypeValue = ClassType | GraphQLScalarType | Function | object | symbol;
export declare type ReturnTypeFuncValue = TypeValue | RecursiveArray<TypeValue>;
I added them manually to the .d.ts file and the enum filter is working fine.
Is there a reason for this or it's just missing and needs to be added?
I have added support to MikroORM smart query conditions in forked repo. So now such requests are possible:
{
variables: {
"filters": {
"and": [
{ "id": { "lt": 3 } },
{
"name": {
"like": "test",
"nin": [ "tester" ]
}
}
]
}
}
}
One sad thing "$" character is not supported in GraphQL so I had to use plain "eq", "and", "in" not "$eq", "$and", "$in". This may limit somehow use but still I think it is convenient.
If you would like to somehow merge it - you are free to go ;)
Love the project, it really filled a need for me today. One thing I feel like it's missing is support for Array specific operators such as includes
so I can say myArray_includes: 32
. Any way we could get something like that added?
Thank you for open sourcing a library like this. ๐
I guess from the implementation its not supported to create filters for nested classes right ? I saw a related PR but just to be sure.
Example :
class Person {
name : string ,
address : Address
}
class Address {
postcode:sting,
address:string
}
in order to create a filter like address_postcode_like = "1234"
Hi
I find it not very straight forward to use this lib as there's no example regarding how to use the filter as query parameter. Would be nice to have one. thanks.
Could you update the type-graphql dependency? The types from your old dependency collides with new most recent version in my project dependencies.
For now, as a workaround i placed your source code inside my project.
In django-filters
they use the double underscore to avoid a name collision and to being explicit that that name is private or autogenerated. The line of code of this generation is this
Hi,
I was wondering, there seems to be a lot of repetition when creating the @Filter
decorators for each field. Could there be a feature added to set up default filters depending on the type of the field?
Scott
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.