| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function handle() |
||
| 45 | { |
||
| 46 | // Clear the Lighthouse cached schema |
||
| 47 | $this->call('lighthouse:clear-cache'); |
||
| 48 | |||
| 49 | $schemaFilePath = config('lighthouse.schema.register'); |
||
| 50 | $this->askWithCompletion( |
||
| 51 | sprintf( |
||
| 52 | 'Generating schema in location: "%s", do you want to continue?', |
||
| 53 | $schemaFilePath |
||
| 54 | ), |
||
| 55 | ['yes', 'no'], |
||
| 56 | 'yes' |
||
| 57 | ); |
||
| 58 | |||
| 59 | $schemaFilesPaths = config('lighthouse-utils.schema_paths'); |
||
| 60 | $generatedSchema = $this->schemaGenerator->generate($schemaFilesPaths); |
||
| 61 | |||
| 62 | $schemaFile = fopen($schemaFilePath, 'wb'); |
||
| 63 | fwrite($schemaFile, $generatedSchema); |
||
|
|
|||
| 64 | |||
| 65 | $this->info('Generation complete.'); |
||
| 66 | } |
||
| 68 |