public function generate(array $definitionFileDirectories): string
    {
        $authEnabled = config('lighthouse-utils.authorization');
        if ($authEnabled) {
            GraphQLSchema::truncate();
        }

        $this->validateFilesPaths($definitionFileDirectories);

        $schema = $this->getSchemaForFiles($definitionFileDirectories);

        $definedTypes = $this->getDefinedTypesFromSchema($schema, $definitionFileDirectories);

        $queries = $this->generateQueriesForDefinedTypes($definedTypes, $definitionFileDirectories);
        $typesImports = $this->concatSchemaDefinitionFilesFromPath(
            $this->definitionsParser->getGraphqlDefinitionFilePaths($definitionFileDirectories['types'])
        );

        if ($authEnabled) {
            event(new GraphQLSchemaGenerated(GraphQLSchema::all()));
        }

        //Merge queries and types into one file with required newlines
        return sprintf("%s\r\n\r\n%s\r\n", $typesImports, $queries);
    }