Generate the schema
- Open the SQLite database.
- Review its entities in the ER diagram.
- Select GraphQL SDL as the export format.
- Export the type definitions and review them in your API project.
type Customer {
id: Int!
name: String
orders: [Order!]
}
type Order {
id: Int!
customerId: Int!
}
SDL is not a complete API
A database schema describes storage, while GraphQL describes an application-facing contract. Generated SDL does not create resolvers, authentication, pagination, validation, mutations or field-level authorization. Treat it as a structured first draft.
Review type mappings
SQLite types do not map perfectly to GraphQL scalars. Dates may be stored as text or numbers, decimals may need a custom scalar, and binary data needs an application-specific representation. Rename technical database fields when a clearer API name is appropriate.
Use relationships deliberately
Declared foreign keys can suggest GraphQL relationships, but resolver behavior depends on your server implementation. Consider batching and pagination to avoid expensive nested database access.