Replies: 1 comment
-
I always recomend such pattern: @InputType()
class FilterValueInput {
@Field()
key: string;
@Field()
value: Filter;
}
// ...
@Query(() => Foo)
public async getAllCount(
@Arg('params', () => [FilterValueInput]) params: [FilterValueInput],
) {
// ...
} So you can then send filter values as: query {
getAllCount(params: [{ key: 'foo', value: BAR }, { key: 'bar', value: FOO }]) {
# ...
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Feature request/question. I have an
InputType
namedFilters
, right now I want to create anotherInputType
calledFiltersByName
, the interface is like this:Question
How do I type the
FiltersByName
for type-graphql?I understand this might be a limitation of graphql scheme itself, but would appreciate it in case you know a better solution.
Describe alternatives you've considered
Right now I'm using
GraphQLJSONObject
forFiltersByName
, which is not ideal:Beta Was this translation helpful? Give feedback.
All reactions