I would suggest writing a custom controller for your graphql query. It is easier to fine-tune queries this way.