Q4: What are the three root operation types in GraphQL?
GraphQL supports three primary root operations:
- Query: Read-only fetches (analogous to HTTP GET).
- Mutation: Write operations that create, update, or delete data (analogous to POST/PUT/DELETE).
- Subscription: Event-driven real-time updates maintained over long-lived transport (e.g., WebSockets).
Key Takeaways
- Queries are read-only, Mutations perform writes, and Subscriptions stream real-time events.
Knowledge Check
Which root operation should be used to modify data in a database?