How to filter inner collections to fetch only records with active status through query? #4254
Unanswered
arjundnair-fingent
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You do not show which "query" you are trying to execute. If we assume you have implemented, for example, "getAllAs" as a query, then the graphql would be:
This also assumes you have filtering on the nested resolver for the details field. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have two objects,
A
andDetail
as follows:I need to write a GraphQL query to fetch the details of
A
. I need to apply a filter to theDetails
collection inA
such that the result object will only haveDetail
data withStatus
1. If there is no record with status 1, it should return an emptyDetails
collection.The query I tried was:
But this doesn't seem to work. It is not applying any filter and is returning all records. Where am I going wrong? Please help me.
Beta Was this translation helpful? Give feedback.
All reactions