1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Digia\GraphQL\SchemaBuilder; |
4
|
|
|
|
5
|
|
|
use Digia\GraphQL\Error\LanguageException; |
6
|
|
|
use Digia\GraphQL\Language\Node\DirectiveDefinitionNode; |
7
|
|
|
use Digia\GraphQL\Language\Node\DocumentNode; |
8
|
|
|
use Digia\GraphQL\Language\Node\NamedTypeNode; |
9
|
|
|
use Digia\GraphQL\Language\Node\SchemaDefinitionNode; |
10
|
|
|
use Digia\GraphQL\Language\Node\TypeDefinitionNodeInterface; |
11
|
|
|
use Digia\GraphQL\Language\Node\TypeNodeInterface; |
12
|
|
|
use Digia\GraphQL\Type\Definition\DirectiveInterface; |
13
|
|
|
use Digia\GraphQL\Type\SchemaInterface; |
|
|
|
|
14
|
|
|
use function Digia\GraphQL\Type\newGraphQLSchema; |
15
|
|
|
use function Digia\GraphQL\Util\arraySome; |
16
|
|
|
|
17
|
|
|
class SchemaBuilder implements SchemaBuilderInterface |
|
|
|
|
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @var BuilderContextCreatorInterface |
|
|
|
|
21
|
|
|
*/ |
22
|
|
|
protected $contextCreator; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* SchemaBuilder constructor. |
26
|
|
|
* @param BuilderContextCreatorInterface $contextCreator |
27
|
|
|
*/ |
28
|
|
|
public function __construct(BuilderContextCreatorInterface $contextCreator) |
29
|
|
|
{ |
30
|
|
|
$this->contextCreator = $contextCreator; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @inheritdoc |
35
|
|
|
*/ |
36
|
|
|
public function build( |
37
|
|
|
DocumentNode $document, |
38
|
|
|
ResolverRegistryInterface $resolverRegistry, |
|
|
|
|
39
|
|
|
array $options = [] |
40
|
|
|
): SchemaInterface { |
41
|
|
|
$context = $this->contextCreator->create($document, $resolverRegistry); |
42
|
|
|
|
43
|
|
|
return newGraphQLSchema([ |
|
|
|
|
44
|
|
|
'query' => $context->buildQueryType(), |
45
|
|
|
'mutation' => $context->buildMutationType(), |
46
|
|
|
'subscription' => $context->buildSubscriptionType(), |
47
|
|
|
'types' => $context->buildTypes(), |
48
|
|
|
'directives' => $context->buildDirectives(), |
49
|
|
|
'astNode' => $context->getSchemaDefinition(), |
50
|
|
|
'assumeValid' => $options['assumeValid'] ?? false, |
51
|
|
|
]); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths