@@ -351,11 +351,11 @@ const load = (parseGraphQLSchema, parseClass, parseClassConfig: ?ParseGraphQLCla
351351 ...defaultGraphQLTypes . PARSE_OBJECT_FIELDS ,
352352 ...( className === '_User'
353353 ? {
354- authDataResponse : {
355- description : `auth provider response when triggered on signUp/logIn.` ,
356- type : defaultGraphQLTypes . OBJECT ,
357- } ,
358- }
354+ authDataResponse : {
355+ description : `auth provider response when triggered on signUp/logIn.` ,
356+ type : defaultGraphQLTypes . OBJECT ,
357+ } ,
358+ }
359359 : { } ) ,
360360 } ;
361361 const outputFields = ( ) => {
@@ -386,8 +386,13 @@ const load = (parseGraphQLSchema, parseClass, parseClassConfig: ?ParseGraphQLCla
386386 const { keys, include } = extractKeysAndInclude (
387387 selectedFields
388388 . filter ( field => field . startsWith ( 'edges.node.' ) )
389- . map ( field => field . replace ( 'edges.node.' , '' ) )
390- . map ( field => field . replace ( / \. e d g e s \. n o d e / g, '' ) )
389+ // GraphQL relation connections expose data under `edges.node.*`. Those
390+ // segments do not correspond to actual Parse fields, so strip them to
391+ // ensure the root relation key remains in the keys list (e.g. convert
392+ // `users.edges.node.username` -> `users.username`). This preserves the
393+ // synthetic relation placeholders that Parse injects while still
394+ // respecting field projections.
395+ . map ( field => field . replace ( 'edges.node.' , '' ) . replace ( / \. e d g e s \. n o d e / g, '' ) )
391396 . filter ( field => field . indexOf ( 'edges.node' ) < 0 )
392397 ) ;
393398 const parseOrder = order && order . join ( ',' ) ;
0 commit comments