-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeORM - Simple-array doesn't work #224
Comments
Interesting, I have the feeling it is because everything "array" is seen as a relation and |
Thank you for your responsiveness and for explaining it to me. It's a project with users who can have multiple roles in the app: artisan, client, admin, etc. So, I use the role to handle this, and I put it in an array to simplify the app and easily include it in the JWT. When I want to retrieve a list of users, I use @Query(() => UserConnection, {
nullable: true,
description: `Liste des artisans`,
})
getArtisans(
@Args() query: UserQuery
): Promise<ConnectionType<User>> {
return this.usersService.indexArtisans(query);
} async indexArtisans(data: UserQuery) {
return UserConnection.createFromPromise(
(q) => this.usersQueryService.query(q),
{ ...data, ...{ filter: data.filter } },
(filter) => this.usersQueryService.count(filter)
);
} But I encounter the aforementioned error. I would have liked to use a query builder and be able to utilize your GraphQL return because it's very convenient, but I couldn't retrieve a query builder with your library, or at least I couldn't find one. 😬 |
Just now see this part:
Yes this is possible, when you create your own service you can pass |
Can you give me an example ? |
Here are some docs on how to create a custom service, in the constructor: super(repo, {
filterQueryBuilder: CustomFilterQueryBuilder
}) |
Closing as it's (I think?) the same as #233 |
Hello,
I want to use FilterableField with a simple-array (typeorm), exemple :
But i have this error :
Error: Unable to create filter comparison for [{"DEVELOPER":"DEVELOPER","ADMIN":"ADMIN","CUSTOMER":"CUSTOMER"}].
Same error when changing from [RolesEnum] to [String]
If you have a solution for me, I'm interested, thank you!
Thank's !
PS : Is it possible to create a typeorm querybuilder to customize the query as I see fit?
I want to use postgis SQL statements
The text was updated successfully, but these errors were encountered: