@@ -196,9 +196,11 @@ public function getNodeInterface(): InterfaceType
196
196
public function getResourcePaginatedCollectionType (GraphQLType $ resourceType , string $ resourceClass , string $ operationName ): GraphQLType
197
197
{
198
198
$ shortName = $ resourceType ->name ;
199
+ $ paginationType = $ this ->pagination ->getGraphQlPaginationType ($ resourceClass , $ operationName );
199
200
200
- if ($ this ->typesContainer ->has ("{$ shortName }Connection " )) {
201
- return $ this ->typesContainer ->get ("{$ shortName }Connection " );
201
+ $ connectionTypeKey = sprintf ('%s%sConnection ' , $ shortName , ucfirst ($ paginationType ));
202
+ if ($ this ->typesContainer ->has ($ connectionTypeKey )) {
203
+ return $ this ->typesContainer ->get ($ connectionTypeKey );
202
204
}
203
205
204
206
$ paginationType = $ this ->pagination ->getGraphQlPaginationType ($ resourceClass , $ operationName );
@@ -208,13 +210,13 @@ public function getResourcePaginatedCollectionType(GraphQLType $resourceType, st
208
210
$ this ->getPageBasedPaginationFields ($ resourceType );
209
211
210
212
$ configuration = [
211
- 'name ' => "{ $ shortName } Connection " ,
212
- 'description ' => " Connection for $ shortName. " ,
213
+ 'name ' => $ connectionTypeKey ,
214
+ 'description ' => sprintf ( " %s connection for $ shortName. ", ucfirst ( $ paginationType )) ,
213
215
'fields ' => $ fields ,
214
216
];
215
217
216
218
$ resourcePaginatedCollectionType = new ObjectType ($ configuration );
217
- $ this ->typesContainer ->set ("{ $ shortName } Connection " , $ resourcePaginatedCollectionType );
219
+ $ this ->typesContainer ->set ($ connectionTypeKey , $ resourcePaginatedCollectionType );
218
220
219
221
return $ resourcePaginatedCollectionType ;
220
222
}
0 commit comments