Skip to content

Nested Query Filter #178

@WuDo

Description

@WuDo

Is there any chance of support nested query filter? So I can filter nested objects e.g.

query list {
    listParentObjects(where:{enabled:{equal: true}}) {
         childElement(where:{counter:{gte: 2}) {
               id
         }
    }
}

In this use case, I want all enabled ParentObjects and for them only their childElements with counter greater then 2.

Now with

query list {
    listParentObjects(where:{enabled:{equal: true}}) {
         childElement {
               id
         }
    }
}

I get all childElements for enabled ParentObjects.

I know I can do:

query list {
    listParentObjects(where:{enabled:{equal: true}, {childElement:{some:{counter:{gte: 2}}}) {
         childElement {
               id
         }
    }
}

But that will give me enabled ParentObjects with at least one childElement with such counter, but all these ParentObjects will still have listed all the childElements.

Some other prisma generators support this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions