Function grafbase_local_backend::project::init
source · [−]pub fn init(name: Option<&str>) -> Result<(), BackendError>Expand description
initializes a new project in the current or a new directory
Errors
-
returns
BackendError::ReadCurrentDirectoryif the current directory cannot be read -
returns
BackendError::ProjectDirectoryExistsif a named is passed and a directory with the same name already exists in the current directory -
returns
BackendError::AlreadyAProjectif there’s already a grafbase/schema.graphql in the target -
returns
BackendError::CreateGrafbaseDirectoryif the grafbase directory cannot be created -
returns
BackendError::WriteSchemaif the schema file cannot be written