blitz generate <type> <model>

Generate new files for your Blitz project

Arguments

NameDescription
typeWhat files to generate
modelThe name of your model, like "user". Can be singular or plural - same result

Options

NameDescription
--help, -hShow help for command
-c, --context <context>Provide a context folder within which we'll place the generated files for better code organization. You can also supply this in the name of the model to be generated (e.g. `blitz generate query admin/projects`). Combining the `--context` flags and supplying context via the model name in the same command is not supported
-p, --parent <parent>Specify a parent model to be used for generating nested routes for dependent data when generating pages, or to create hierarchical validation in queries and mutations. The code will be generated with the nested data model in mind. Most often this should be used in conjunction with 'blitz generate all'
-d, --dry-runShow what files will be created without writing them to disk