File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ export const generateGraphqlClientTypes = async () => {
3636 config : {
3737 preResolveTypes : true , // Simplifies the generated types
3838 namingConvention : 'keep' , // Keeps naming as-is
39- nonOptionalTypename : true , // Forces `__typename` on all selection sets
40- skipTypeNameForRoot : true , // Don't generate __typename for root types
39+ skipTypename : true , // Don't generate __typename
4140 avoidOptionals : {
4241 // Avoids optionals on the level of the field
4342 field : true ,
Original file line number Diff line number Diff line change @@ -153,11 +153,13 @@ const applySubQueries = async (
153153 const children = hydrate ( subNode , rawChildren ) ;
154154
155155 for ( const child of children ) {
156+ const childClone = cloneDeep ( child ) ;
156157 for ( const entry of entriesById [ child [ foreignKey ] as string ] ) {
158+ childClone . PARENT = entry ;
157159 if ( isList ) {
158- ( entry [ fieldName ] as Entry [ ] ) . push ( cloneDeep ( child ) ) ;
160+ ( entry [ fieldName ] as Entry [ ] ) . push ( childClone ) ;
159161 } else {
160- entry [ fieldName ] = cloneDeep ( child ) ;
162+ entry [ fieldName ] = childClone ;
161163 }
162164 }
163165 }
Original file line number Diff line number Diff line change @@ -88,10 +88,13 @@ export function hydrate<T extends Entry>(
8888 continue outer;
8989 }
9090 }
91- current [ part ] = { } ;
91+ current [ part ] = {
92+ PARENT : current ,
93+ } ;
9294 }
9395 current = current [ part ] ;
9496 }
97+
9598 current [ it ( fieldName ) ] = value ;
9699 }
97100
You can’t perform that action at this time.
0 commit comments