Query files from parent when there is non

I have this field that queries its files from the page itself, it’s siblings and its parent.

image:
    type: files
    query: page.images.add(page.parent.images).add(page.siblings.images)

However, if I use it in a page that has no parent, I get an error and thus can`t even select the images from the page itself:

Your query must return a set of files

I believe that has to do with the add()function throwing an exception, when it receives an invalid object.

Is there a way to get an empty collection if there is no parent or no siblings so that the query above would simply return the pages own images?

Thanks for your help :slight_smile:

Try

query: page.images.add(page.parent?.images).add(page.siblings.images)

Works like charm :slight_smile:
Thank you so much!