Check out example codes for "will graphql replace sql". It will help you in understanding the concepts better.

Code Example 1

GraphQL is an alternative to REST, not SQL. GraphQL is not SQL! Instead, GraphQL is data-agonistic, and GraphQL, being one of the possible and most popular way, uses SQL to fetch data

Learn ReactJs, React Native from