Beginner GraphQL Interview Questions
1. What is GraphQL?
GraphQL is a query language for APIs and a runtime that executes those queries against a type system defined by the server.
2. Who originally developed GraphQL?
GraphQL was developed at Facebook and publicly released as an open-source project in 2015.
3. How is GraphQL different from REST?
REST commonly exposes multiple resource-oriented endpoints, while GraphQL commonly exposes a single endpoint through which clients specify the fields and relationships they need.
4. What is a GraphQL schema?
A schema defines the types, fields, arguments, relationships, and operations available through the GraphQL API.
5. What is SDL?
SDL stands for Schema Definition Language. It is the syntax used to define GraphQL types and schemas.
6. What are Query, Mutation, and Subscription?
Query is used to retrieve data, Mutation is used for state-changing operations, and Subscription represents an event stream for real-time updates.
7. What is a resolver?
A resolver is a function responsible for obtaining or computing the value of a GraphQL field.
8. What is a GraphQL type?
A GraphQL type defines the structure and allowed values for data exposed through the schema.
9. What is the difference between String and String!?
String may be null, while String! indicates that the field must return a non-null string.
10. What is an argument in GraphQL?
An argument allows a client to provide input to a field, such as an ID used to retrieve a specific resource.