Is it possible to pass an argument in a query chain like this

Is it possible to pass an argument in a query chain like this:
On the second level, I want to be able to tell the chain to include/exclude child nodes

query Query($spaceId: String!) {
  getNodeById(id: $Id) {
    isLocationOf(**includeChild: false/true)** {
      node {
        id
        attribute1
        attribute2
        attribute3
    }
  }
}

admin note: edited to format code font

Hello! If I understand correctly, you’d like to reuse a query that includes fields that you sometimes don’t want to query for. Yes, you can approximate this behavior.

In your resolver for isLocationOf, you can check the value of includeChild. If it’s false, you can add a corresponding boolean flag to the shared context argument.

Then, in the resolver for node (or whatever field you want to selectively exclude), first check context to see if that flag has been set. If it has, return null instead of what you would return otherwise.

Note that for this to work, the field you want to selectively exclude must be nullable in your schema.