GraphQL вопросы и ответы для интервью
Связанные сравнения
Вопрос 16. What is the role of directives in GraphQL?
Directives in GraphQL are used to modify the behavior of a field or an entire query. They provide a way to conditionally include or skip fields, apply transformations, and control the execution of a query.
Вопрос 17. How does GraphQL handle versioning of APIs?
GraphQL avoids versioning by allowing clients to specify the exact shape of the response they need. This flexibility prevents breaking changes, as clients can evolve independently without relying on specific API versions.
Вопрос 18. What is the purpose of the `context` object in GraphQL resolvers?
The `context` object in GraphQL resolvers is used to share contextual information, such as authentication details or database connections, among different parts of the application. It is often passed as an argument to resolvers.
Вопрос 19. Explain the concept of batching in GraphQL.
Batching in GraphQL involves combining multiple queries or mutations into a single request to the server. This helps in reducing the number of network requests and improving the overall efficiency of data fetching.
Вопрос 20. What is a schema in GraphQL?
A schema in GraphQL defines the types of data that can be queried and the relationships between them. It serves as a contract between the client and the server, specifying the structure of the API.
Самое полезное по оценкам пользователей: