I have been looking at some GraphQL implementations and what I understand is that GraphQL lets you traverse through the data in the form of a Graph.
Which means you get a list of books which is a REST call. The books might have an Author Name.
When the user wants more info on an author he says so and another REST call is made to fetch more details about that author.
Similarly the books list may have a field called Publisher and so on. So here you fetch data as if you are connecting a node of Book to a node of Author or Publisher.
But I have seen some implementations where data from two rest calls are combined using for
loops and presented in the UI. e.g. make a call to REST API of Books, then make a call to REST API of Authors who have written those books. Run a for
nested for-loop(n^2 complexity) to combine the result and show information of both books and authors in one single summary view.
Is this an acceptable practice or is it breaking some core concepts of what GraphQL is not supposed to do?