Can we use graphql where it is not a single table query? In a way tables are in many to many or in one to one relationship. Also, in some cases data can be available after joining 4 to 5 tables. So how can we use graphql in such case?
Yes, that's possible, although it's not GraphQL's role to make this happen. GraphQL is used to describe which data the client needs - it's up to the server to retrieve that data, and return it to the client. So the client need not be aware whether the data comes from one or more tables, or whether it comes from a relational DB at all. So there's a decoupling, and the server-side data architecture could change fundamentally without the client ever becoming aware of it.