File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,7 +175,24 @@ if (!liveEnv) {
175175 } ,
176176 } )
177177 . unwrap ( ) ;
178- assert . ok ( Array . isArray ( firstResult . users . nodes ) , 'findFirst should return users.nodes array' ) ;
178+ assert . ok (
179+ firstResult . user === null || typeof firstResult . user === 'object' ,
180+ 'findFirst should return a single user object (or null), not an array'
181+ ) ;
182+ if ( firstResult . user ) {
183+ assert . equal ( typeof firstResult . user . id , 'string' , 'findFirst result should expose scalar id' ) ;
184+ }
185+
186+ const orderedResult = await client . user
187+ . findFirst ( {
188+ select : { id : true , username : true } ,
189+ orderBy : [ 'CREATED_AT_DESC' ] ,
190+ } )
191+ . unwrap ( ) ;
192+ assert . ok (
193+ orderedResult . user === null || typeof orderedResult . user === 'object' ,
194+ 'findFirst with orderBy should return a single user object (or null)'
195+ ) ;
179196
180197 const currentUserResult = await client . query
181198 . currentUser ( {
You can’t perform that action at this time.
0 commit comments