Q3: What is the GraphQL Schema and SDL?
The GraphQL Schema defines the hierarchy of types, fields, inputs, and operations available on the server. Schema Definition Language (SDL) is the standard human-readable syntax used to write GraphQL schemas.
type User {
id: ID!
name: String!
email: String
}
Key Takeaways
- The Schema acts as a strongly-typed contract between frontend and backend.
- SDL is the language-agnostic syntax used to declare GraphQL types.
Knowledge Check
What does the exclamation mark `!` indicate in SDL (e.g., `id: ID!`)?