GraphQL Application Components
GraphQL components are very important to make communication happen. Let's see what the important GraphQL key components and the way they communicate with each other are.
There are 2 types of GraphQL application components:
GraphQL Server-side Components
The GraphQL API uses three main components that reside on the GraphQL server. These components are query, resolver, and schema. Server-side components allow parsing the queries coming from GraphQL client applications.
The most popular GraphQL server is Apollo Server, which is an open-source, spec-compliant GraphQL server. It is compatible with any GraphQL client such as Apollo Client.
GraphQL is simply a specification. We have to use some GraphQL server implementations to make communication.
Types of GraphQL Servers Implementation
GraphQL-JS: GraphQL-JS is used with Express. It is the original reference implementation of GraphQL.
GraphQL-Server: GraphQL-Server is the all-in-one GraphQL server implementation of Apollo. It can be accessed from any GraphQL client.
GraphQL-Serverless: GraphQL-Serverless is the Back4App instant GraphQL API fully integrated with MongoDB database and Cloud Functions.
GraphQL Yoga: GraphQL Yoga is Prisma's server implementation built on Express and Appolo servers.
GraphQL Client-side Components
See the below client-side components:
GraphiQL: It is a browser-based interface used for editing and testing GraphQL queries and mutations.
We can query our GraphQL API directly, but it is always a good practice to use a dedicated client library. It also makes things easier.
Apollo Engine is the most popular GraphQL gateway. It provides features like query caching, query execution tracing, and field-level error tracking, and API performance trend analysis.