File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -175,12 +175,19 @@ export default function createSearchResolver<TSource, TContext>(
175175 }
176176
177177 const res : any = await searchFC . resolve ( rp . source , args , rp . context , rp . info ) ;
178-
179- res . count =
180- typeof res . hits . total ?. value === 'number' ? res . hits . total . value : res . hits . total ;
181- res . max_score = res . hits . max_score ;
182- res . hits = res . hits . hits ;
183-
178+ if ( typeof res . hits === 'undefined' ) {
179+ res . count =
180+ typeof res . body . hits . total ?. value === 'number'
181+ ? res . body . hits . total . value
182+ : res . body . hits . total ;
183+ res . max_score = res . body . hits . max_score ;
184+ res . hits = res . body . hits . hits ;
185+ } else {
186+ res . count =
187+ typeof res . hits . total ?. value === 'number' ? res . hits . total . value : res . hits . total ;
188+ res . max_score = res . hits . max_score ;
189+ res . hits = res . hits . hits ;
190+ }
184191 return res ;
185192 } ,
186193 } )
You can’t perform that action at this time.
0 commit comments