@@ -13,7 +13,7 @@ function getConnectionTypes(prefix) {
1313 }
1414
1515 extend type ${ prefix } EventGroup {
16- cmsEventGroup: CmsEvent
16+ cmsEventGroup: CmsEventCollection
1717 }
1818
1919 extend type ${ prefix } PublicPerson {
@@ -68,35 +68,17 @@ function getConnectionResolvers(prefix, schemas) {
6868 selectionSet : "{ contentfulId }" ,
6969 async resolve ( parent , args , context , info ) {
7070 if ( ! parent . contentfulId ) return null ;
71- return batchDelegateToSchema ( {
71+ return delegateToSchema ( {
7272 schema : schemas . cms ,
7373 operation : "query" ,
74- fieldName : "eventCollection" ,
75- key : parent . contentfulId ,
76- argsFromKeys : ( id ) => ( { where : { id } } ) ,
74+ fieldName : 'eventCollection' ,
7775 context,
7876 info,
79- valuesFromResults : ( results , keys ) =>
80- keys ?. map ( ( key ) =>
81- results . find ( ( result ) => result ?. id === key )
82- ) ,
83- transforms : [
84- new AddFieldToRequestTransform ( schemas . cms , "Event" , "id" ) ,
85- new TransformQuery ( {
86- path : [ 'eventCollection' ] ,
87- queryTransformer : ( subtree ) => ( {
88- kind : Kind . SELECTION_SET ,
89- selections : [
90- {
91- kind : Kind . FIELD ,
92- name : { kind : Kind . NAME , value : 'items' } ,
93- selectionSet : subtree ,
94- } ,
95- ] ,
96- } ) ,
97- resultTransformer : ( result ) => ( result ?. items || [ ] )
98- } ) ,
99- ] ,
77+ args : {
78+ where : {
79+ id : parent . contentfulId ,
80+ } ,
81+ } ,
10082 } ) ;
10183 } ,
10284 } ,
0 commit comments