GithubHelp home page GithubHelp logo

type-graphql-filter's People

Contributors

dependabot[bot] avatar hihuz avatar johannespfeiffer avatar lera avatar pgrund avatar sepehrdaddev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

type-graphql-filter's Issues

Can't use enums in filter decorator - types problem

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.

export type ReturnTypeFunc = (type?: void) => GraphQLScalarType | Function;

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?

MikroORM smart conditions support

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 ;)

Array specific operator support

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?

Create filters for nested classes.

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"

Update type-graphql dependency

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.

Creating default filter sets for types

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.