Câu hỏi phỏng vấn GraphQL
Câu hỏi

What kind of operations could GraphQL schema have?

Câu trả lời

A GraphQL schema can have three main types of operations: queries, mutations, and subscriptions.

  1. Queries:

    • Queries are used to read or fetch data from the server. They allow clients to request specific data and receive exactly what they ask for, making data retrieval efficient and precise. For example, a query might request a list of books with their titles and authors[1][3][8][9][13].
  2. Mutations:

    • Mutations are used to modify data on the server. This includes creating, updating, or deleting data. Each mutation operation specifies the changes to be made and can return the modified data. For instance, a mutation might add a new author or update the details of an existing book[1][8][9][13].
  3. Subscriptions:

    • Subscriptions are used to listen for real-time updates from the server. They allow clients to receive live data updates whenever specific events occur on the server. Subscriptions are typically implemented using WebSockets to provide a continuous stream of data. For example, a subscription might notify clients whenever a new book is added to the database[1][8][9][13].

These operations are defined in the...

middle

middle

Gợi ý câu hỏi phỏng vấn

junior

How to do Error Handling in GraphQL?

middle

How to do Authentication and Authorization in GraphQL?

middle

List the key concepts of the GraphQL query language

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào