The essence of logic programming[0] is in enabling a particular kind of exchange. On the one hand, there's a knowlege base -- a specification of what is known in the form of facts/rules/relations. On the other, there's a quest to satisfy some goal. In particular, the query may filter the knowledge base for a particular representation of facts. The query is nothing but a problem statement. In the middle, there's an engine that deduces the answers to queries, however the implementation is hidden from the user. In the ideal world, the user does not concern herself about how the search could be performed at all. The engine would magically produce the answer. (For efficiency's sake, this is not always the case in practice.) GraphQL is built in this spirit. There's an opportunity for a more detailed blog post here. I'll see to it when I get a chance.
[0] https://en.wikipedia.org/wiki/Logic_programming