File tree 2 files changed +11
-4
lines changed 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function schema($schema = null)
67
67
$ this ->typesInstances [$ name ] = $ objectType ;
68
68
$ types [] = $ objectType ;
69
69
70
- $ this ->addType ($ type , $ name );
70
+ $ this ->addType ($ type , is_numeric ( $ name ) ? null : $ name );
71
71
}
72
72
} else {
73
73
foreach ($ this ->types as $ name => $ type ) {
Original file line number Diff line number Diff line change @@ -77,14 +77,21 @@ public function testSchemaWithArray()
77
77
'updateExampleCustom ' => UpdateExampleMutation::class
78
78
],
79
79
'types ' => [
80
- CustomExampleType::class
80
+ CustomExampleType::class,
81
+ AnotherCustomExampleType::class
81
82
]
82
83
]);
83
-
84
+
85
+ $ graphql_types = GraphQL::getTypes ();
86
+ $ schema_types = $ schema ->getTypeMap ();
87
+
84
88
$ this ->assertGraphQLSchema ($ schema );
85
89
$ this ->assertGraphQLSchemaHasQuery ($ schema , 'examplesCustom ' );
86
90
$ this ->assertGraphQLSchemaHasMutation ($ schema , 'updateExampleCustom ' );
87
- $ this ->assertArrayHasKey ('CustomExample ' , $ schema ->getTypeMap ());
91
+ $ this ->assertArrayHasKey ('CustomExample ' , $ schema_types );
92
+ $ this ->assertArrayHasKey ('AnotherCustomExample ' , $ schema_types );
93
+ $ this ->assertArrayHasKey ('CustomExample ' , $ graphql_types );
94
+ $ this ->assertArrayHasKey ('AnotherCustomExample ' , $ graphql_types );
88
95
}
89
96
90
97
/**
You can’t perform that action at this time.
0 commit comments