GraphQL was created internally by Facebook in 2012 and has become increasingly popular over the last years. This article will cover the basics of what GraphQL is. You will also learn how GraphQL compares with other query languages such as GROQ, and learn how to start testing GraphQL on a project.
GraphQL is a pattern and an open-source query language for API’s connected to data, consisting of a type system, query language, execution semantics, static validation, and type introspection.
GraphQL enables developers to get the exact information they need in a flexible way, by letting the client define the structure of the data required. By using GraphQL, developers also benefit from the growing GraphQL ecosystem, where new flexible tooling and libraries are added regularly.
Some popular caching and fetch clients for GraphQL include; Apollo , Relay Modern, FetchQL, GraphQL Request, Lokka, Micro GraphQL React and URQL.
While GraphQL is becoming increasingly popular, Sanity.io was built with GROQ as the core query language. The idea behind GROQ, is to be able to describe exactly what information your application needs, while enabling ad hoc joining information from several sets of documents, then stitching together a very specific response with only the exact fields you need.
With Sanity.io’s GROQ and GraphQL endpoints, you'll be hard to find a more versatile API offering for structured content.
I love @sanity_io. You should check them out as well. I've used it with React in a few projects, and it's really smooth. Their GraphQL-like query language is also a big plus.