How can I fetch accounts and contacts item data of an particular deals item

Hi Team,
I am creating an monday app where I am display some data on the app importing that from monday CRM. I am able to fetch all the details about the deals board but I wanted to fetch some of the accounts and contacts data that is related to a particular deal item.
Suppose we have deal1, deal2, deal3, and I want to fetch industry which is on the accounts board, how can I do this in my app using an easier way. I have used graphQL to get the data but its getting complicated as I dont have direct access to accounts and contacts of a particular item. Somehow I need to figure out the id of the accounts and contacts item to get the data.
Let me know how this can be achieved in an easier way possible.

If you know the item id in the deals board, and the column id of the columns which connects to the accounts/contacts you can build a GraphQL query using the columns of type connected_board and link all your boards together.