pwweb / artomator

Artomator: Custom commands making life easier for Laravel.
MIT License
4 stars 1 forks source link

graphql/schema.graphql cannot be created on blank project #36

Closed frankpde closed 4 years ago

frankpde commented 4 years ago

Using artisan artomator:graphql_scaffold MyModel results in an error when the program attempts to create schema.graphql:

 ErrorException 

  file_get_contents(*****/graphql/schema.graphql): failed to open stream: No such file or directory

  at vendor/pwweb/artomator/src/Generators/GraphQL/GraphQLQueryGenerator.php:35
    31|     public function __construct(CommandData $commandData)
    32|     {
    33|         $this->commandData = $commandData;
    34|         $this->fileName = $commandData->config->pathGraphQL;
  > 35|         $this->fileContents = file_get_contents($this->fileName);
    36|         $this->templateData = get_artomator_template('graphql.query');
    37|         $this->templateData = fill_template($this->commandData->dynamicVars, $this->templateData);
    38|     }
    39| 

      +17 vendor frames 
  18  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
rabrowne85 commented 4 years ago

You need to perform at least the following:

$ php artisan vendor:publish --tag=artomator

This will generate the graphql.schema file, which is needed before you can run any GraphQL based commands.