Node.js / NestJS

GraphQL with NestJS

Apollo Server, resolvers, schemas, queries, mutations, subscriptions, data loaders

25 面接問題·
Mid-Level
1

What is GraphQL?

回答

GraphQL is a query language for APIs developed by Facebook, allowing clients to request exactly the data they need. Unlike REST where each endpoint returns a fixed structure, GraphQL provides a single entry point with a strongly typed schema. This approach reduces over-fetching and under-fetching of data while improving application performance.

2

What is the main role of a GraphQL schema?

回答

The GraphQL schema defines the complete API structure by specifying available data types, queries, mutations, and relationships between entities. It serves as a contract between client and server, enabling automatic query validation and autocomplete in development tools. The schema uses Schema Definition Language (SDL) to declaratively describe types and their fields.

3

What is the difference between Query and Mutation?

回答

Queries are used to read data without modifying server state, while Mutations are used to create, update or delete data. This semantic distinction helps understand an operation's intent and allows the server to apply specific optimizations. By convention, Queries can be executed in parallel, while Mutations are executed sequentially to ensure data consistency.

4

What is a resolver in GraphQL?

5

Which NestJS decorator defines a GraphQL Query?

+22 面接問題

次の面接に向けてNode.js / NestJSをマスター

すべての問題、flashcards、技術テスト、コードレビュー演習、面接シミュレーターにアクセス。

無料で始める