Seems it cannot correctly generate the nested model with extend/merge.
import { QueryWithZod, ZodArgs } from 'nestjs-graphql-zod'
import { z } from 'zod'
const Base = z.object({
foo: z.string(),
nested: z.object({ bar: z.string() }),
})
const Sub = Base.extend({
baz: z.string(),
// nested: z.object({ bar: z.string() }), manually override this property will work
})
export class AppMetaResolver {
@QueryWithZod(Sub)
async createApp(@ZodArgs(Base) input: ZodArgs.Of<typeof Base>) {
// ...
}
}
CannotDetermineInputTypeError: Cannot determine a GraphQL input type ("DynamicZodModel") for the "nested". Make sure your class is decorated with an appropriate decorator.
at InputTypeFactory.create
As title.
Seems it cannot correctly generate the nested model with
extend/merge
.