diff --git a/src/testHelpers.ts b/src/testHelpers.ts index edf17f3..d6bb493 100644 --- a/src/testHelpers.ts +++ b/src/testHelpers.ts @@ -4,6 +4,7 @@ import { Resolver, ObjectTypeComposerFieldConfigAsObjectDefinition, inspect, + SchemaPrinterOptions, } from 'graphql-compose'; const FIELD = 'field'; @@ -124,16 +125,20 @@ export async function testOperationErrors( return res?.errors; } -export function testSDL(opts: { - fc: ObjectTypeComposerFieldConfigAsObjectDefinition | Resolver; - schemaComposer?: SchemaComposer; - deep?: boolean; -}): string { +export function testSDL( + opts: { + fc: ObjectTypeComposerFieldConfigAsObjectDefinition | Resolver; + schemaComposer?: SchemaComposer; + deep?: boolean; + } & SchemaPrinterOptions +): string { const sc = opts.schemaComposer || new SchemaComposer(); sc.Query.setField(FIELD, opts.fc); sc.buildSchema(); return sc.Query.toSDL({ + ...opts, deep: opts.deep ?? true, omitDescriptions: true, + omitSpecifiedByUrl: true, }); }