BFF with GraphQL

mahesh
3 min readApr 17, 2023

What

When working on a BFF with GraphQL, you often come across the below terminologies.

Query: A query is a request to read or fetch data from a GraphQL API. It’s similar to a GET request in RESTful APIs. The frontend sends a query specifying the data it needs, and the backend returns the requested data.

Mutation: A mutation is a request to modify data in a GraphQL API, such as creating, updating, or deleting data. Mutations are similar to POST, PUT, or DELETE requests in RESTful APIs.

Subscription: A subscription is a real-time connection between the client (frontend) and the server (backend) to receive updates when specific data changes. Subscriptions use WebSockets to maintain a persistent connection.

Schema: A schema defines the structure and types of data that a GraphQL API can handle. It acts as a contract between the client and the server, specifying the available queries, mutations, and subscriptions and the data types that can be returned.

Type: A type in GraphQL represents a data structure, defining the fields and their data types. Types can be built-in, such as String, Int, Float, and Boolean, or custom-defined to represent more complex objects like User, Product, or Order.

Field: A field is a piece of data that belongs to a type. For example, a User type might have fields like id, name, and email.

How

--

--