What is GraphQL?
Liron Abutbul

Liron Abutbul

Feb 02, 2023

What is GraphQL?

Introduction to GraphQL

GraphQL is a query language for your API, and a server-side runtime for executing queries using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.

A GraphQL service is created by defining types and fields on those types, then providing functions for each field on each type. For example, a GraphQL service that tells you who the logged in user is (me) as well as that user's name might look like this:

Along with functions for each field on each type:

After a GraphQL service is running (typically at a URL on a web service), it can receive GraphQL queries to validate and execute. The service first checks a query to ensure it only refers to the types and fields defined, and then runs the provided functions to produce a result.

For example, the query:

Could produce the following JSON result:

Liron Abutbul

Liron Abutbul

Full Stack Developer, Computer Software Engineering Student

Leave a Reply

Related Posts

Categories