Skip to content

How to add a custom query field? #131

Answered by TriPSs
Diluka asked this question in Q&A
Apr 19, 2023 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

I would recommend creating your own resolver with a custom endpoint so you can extend the default query args, then when calling the service instead of doing the following:

    return TodoItemConnection.createFromPromise((q) => this.service.query(q), { ...query, ...{ filter } });

Do

    return TodoItemConnection.createFromPromise((q) =>  {
       const qbBuilder = this.service.filterQueryBuilder.select(q)
       // Do with qbBuilder what you want here
       return qbBuilder.getMany()
    }, { ...query, ...{ filter } });

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@Diluka
Comment options

Comment options

You must be logged in to vote
1 reply
@Diluka
Comment options

Comment options

You must be logged in to vote
4 replies
@Diluka
Comment options

@Diluka
Comment options

@Diluka
Comment options

@Diluka
Comment options

Answer selected by Diluka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants