Skip to content

Commit 0a92169

Browse files
vhenzlspawnia
andauthored
Align BuildSchemaTest with graphql-js (#928)
Co-authored-by: Benedikt Franke <benedikt.franke@mll.com>
1 parent 164e16f commit 0a92169

File tree

3 files changed

+767
-525
lines changed

3 files changed

+767
-525
lines changed

src/Utils/BuildSchema.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,18 @@ static function (string $typeName): Type {
179179
$directiveDefs
180180
);
181181

182-
// If specified directives were not explicitly declared, add them.
183182
$directivesByName = [];
184183
foreach ($directives as $directive) {
185184
$directivesByName[$directive->name][] = $directive;
186185
}
187186

188-
if (! isset($directivesByName['skip'])) {
189-
$directives[] = Directive::skipDirective();
190-
}
191-
187+
// If specified directives were not explicitly declared, add them.
192188
if (! isset($directivesByName['include'])) {
193189
$directives[] = Directive::includeDirective();
194190
}
195-
191+
if (! isset($directivesByName['skip'])) {
192+
$directives[] = Directive::skipDirective();
193+
}
196194
if (! isset($directivesByName['deprecated'])) {
197195
$directives[] = Directive::deprecatedDirective();
198196
}

tests/Type/IntrospectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ public function testExecutesAnIntrospectionQuery(): void
833833
],
834834
'directives' => [
835835
[
836-
'name' => 'skip',
836+
'name' => 'include',
837837
'args' => [
838838
0 => [
839839
'name' => 'if',
@@ -857,7 +857,7 @@ public function testExecutesAnIntrospectionQuery(): void
857857
],
858858
],
859859
[
860-
'name' => 'include',
860+
'name' => 'skip',
861861
'args' => [
862862
0 => [
863863
'name' => 'if',

0 commit comments

Comments
 (0)