Schema codegen
Strawberry supports code generation from SDL files.
Letβs assume we have the following SDL file:
type Query { user: User}
type User { id: ID! name: String!}
by running the following command:
strawberry schema-codegen schema.graphql
weβll get the following output:
import strawberry
@strawberry.typeclass Query: user: User | None
@strawberry.typeclass User: id: strawberry.ID name: str
schema = strawberry.Schema(query=Query)