private function getSchemaForFiles(array $definitionFileDirectories): Schema
    {
        resolve('events')->listen(
            BuildingAST::class,
            function () use ($definitionFileDirectories) {
                $typeDefinitionPaths = $this->definitionsParser->getGraphqlDefinitionFilePaths(
                    $definitionFileDirectories['types']
                );
                $relativeTypeImports = $this->concatSchemaDefinitionFilesFromPath($typeDefinitionPaths);

                // Webonyx GraphQL will not generate a schema if there is not at least one query
                // So just pretend we have one
                $placeholderQuery = 'type Query{placeholder:String}';
                return "$relativeTypeImports\r\n$placeholderQuery";
            }
        );

        $schema = graphql()->prepSchema();

        return $schema;
    }