File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
use GraphQL \Type \Schema ;
8
8
use GraphQL \Type \Definition \CustomScalarType ;
9
+ use GraphQL \Type \Definition \Directive ;
9
10
use GraphQL \Type \Definition \ObjectType ;
10
11
use GraphQL \Type \Definition \UnionType ;
11
12
use GraphQL \Type \Definition \Type ;
@@ -63,7 +64,7 @@ class FederatedSchema extends Schema
63
64
public function __construct ($ config )
64
65
{
65
66
$ this ->entityTypes = $ this ->extractEntityTypes ($ config );
66
- $ this ->entityDirectives = Directives::getDirectives ();
67
+ $ this ->entityDirectives = array_merge ( Directives::getDirectives (), Directive:: getInternalDirectives () );
67
68
68
69
$ config = array_merge ($ config , $ this ->getEntityDirectivesConfig ($ config ), $ this ->getQueryTypeConfig ($ config ));
69
70
Original file line number Diff line number Diff line change @@ -62,6 +62,12 @@ public function testDirectives()
62
62
$ this ->assertArrayHasKey ('external ' , $ directives );
63
63
$ this ->assertArrayHasKey ('provides ' , $ directives );
64
64
$ this ->assertArrayHasKey ('requires ' , $ directives );
65
+
66
+ // These are the default directives, which should not be replaced
67
+ // https://www.apollographql.com/docs/apollo-server/schema/directives#default-directives
68
+ $ this ->assertArrayHasKey ('include ' , $ directives );
69
+ $ this ->assertArrayHasKey ('skip ' , $ directives );
70
+ $ this ->assertArrayHasKey ('deprecated ' , $ directives );
65
71
}
66
72
67
73
public function testServiceSdl ()
You can’t perform that action at this time.
0 commit comments