Discover the fundamental principles and best practices for implementing GraphQL in your Web API. This guide provides insights into when to use GraphQL, detailed error messaging, and valuable learning resources.
GraphQL is a query language for your API. Check the video below to have a quick intro.
GraphQL is a query language for your APIs. It lets you expose a schema, which is a combination of types, queries, and mutations and your client applications can define their own queries based on that schema. You can think of it as SQL for the web.
GraphQL was developed by Facebook in 2012 to solve a problem with their mobile app, which was chewing users' data and battery and leading to negative reviews. This is because the Facebook newsfeed combines data from many entities and data sources, which required multiple API calls. GraphQL allowed them to retrieve all the data they need with 1 call.
Good error design is as important to the success of an API as the API design itself. A good error message provides context and visibility on how to troubleshoot and resolve issues at critical times.
Client-side validation provides a great user experience but this must always be backed up by server-side validation.