@@ -4,16 +4,19 @@ import { DateScalar } from '../../../tests/_/fixtures/scalars.js'
4
4
import type { db } from '../../../tests/_/schemas/db.js'
5
5
import { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js'
6
6
import * as Schema from '../../../tests/_/schemas/kitchen-sink/schema.js'
7
+ import { Graffle as Pokemon } from '../../../tests/_/schemas/pokemon/graffle/__.js'
7
8
8
9
const graffle = Graffle . create ( { schema : Schema . schema } ) . scalar ( DateScalar )
9
10
10
- const x = await graffle . query . id ( { $include : false } )
11
+ // const pokemons = await Pokemon.create().query.pokemons({id:true})
12
+
11
13
// dprint-ignore
12
14
test ( `query` , async ( ) => {
15
+ expectTypeOf ( await graffle . query . object ( { id :[ 'id2' , true ] } ) ) . toEqualTypeOf < { id2 :null | string } | null > ( )
13
16
// scalar
14
17
expectTypeOf ( await graffle . query . id ( ) ) . toEqualTypeOf < string | null > ( )
15
18
// scalar none-nullable
16
- expectTypeOf ( await graffle . query . idNonNull ( ) ) . toEqualTypeOf < null | string > ( )
19
+ expectTypeOf ( await graffle . query . idNonNull ( ) ) . toEqualTypeOf < string > ( )
17
20
// scalar with optional arguments
18
21
expectTypeOf < Parameters < typeof graffle . query . stringWithArgs > > ( ) . toEqualTypeOf < [ input ?: Graffle . SelectionSets . Query . stringWithArgs ] > ( )
19
22
// scalar with required arguments
@@ -23,16 +26,14 @@ test(`query`, async () => {
23
26
24
27
// scalar with explicit indicators
25
28
// positive indicator
26
- expectTypeOf ( await graffle . query . idNonNull ( true ) ) . toEqualTypeOf < null | string > ( )
29
+ expectTypeOf ( await graffle . query . idNonNull ( true ) ) . toEqualTypeOf < string > ( )
27
30
// negative indicator
28
31
// todo
29
32
// expectTypeOf(await graffle.query.idNonNull(false)).toEqualTypeOf<null>()
30
33
// negative indicator via directive
31
34
// todo
32
35
// expectTypeOf(await graffle.query.idNonNull({ $skip: false })).toEqualTypeOf<null>()
33
36
34
- const x = await graffle . query . dateObject1 ( { $scalars : true } )
35
-
36
37
// object
37
38
expectTypeOf ( graffle . query . dateObject1 ( { date1 : true } ) ) . resolves . toEqualTypeOf < { date1 : Date | null } | null > ( )
38
39
expectTypeOf ( graffle . query . unionFooBar ( { ___on_Foo : { id : true } } ) ) . resolves . toEqualTypeOf < { } | { id : string | null } | null > ( )
0 commit comments