ReasonJun

GraphQL : Resolver 본문

Backend/GraphQL

GraphQL : Resolver

ReasonJun 2023. 9. 4. 23:42
728x90

A resolver in GraphQL is a function that is responsible for fetching the data for a single field in a GraphQL schema. Resolvers are typically written in JavaScript, but they can be written in any language that can be executed on the server.

 

When a client makes a GraphQL query, the resolvers for the fields in the query are called in order to fetch the data. The resolvers can fetch data from a variety of sources, such as a database, a file system, or a third-party API.

Resolvers can also be used to perform complex operations on the data, such as filtering, sorting, and transforming. The resolvers for a field can be customized to meet the specific needs of the application.

 

Resolvers are an important part of GraphQL, and they allow you to customize the way that data is fetched and processed. By using resolvers, you can build GraphQL APIs that are efficient, flexible, and scalable.

 

Here are some of the things that resolvers can do:

  • Fetch data from a database or other data source.
  • Perform complex operations on data, such as filtering, sorting, and transforming.
  • Inject custom logic into the query execution process.
  • Customize the way that errors are handled.

 

https://www.apollographql.com/docs/apollo-server/data/resolvers/

 

Resolvers

How Apollo Server processes GraphQL operations

www.apollographql.com

 

728x90

'Backend > GraphQL' 카테고리의 다른 글

GraphQL : Fetch Policy  (0) 2023.09.06
GraphQL : Normalization  (0) 2023.09.06
GraphQL : Cache  (0) 2023.09.06
GraphQL : Apollo  (0) 2023.09.05
GraphQL : Concept  (0) 2023.09.04
Comments