From babebbfdea6c36466d62f36f4603c04fe26b6085 Mon Sep 17 00:00:00 2001 From: sanny-io Date: Fri, 7 Aug 2026 12:50:11 +0000 Subject: [PATCH 1/5] feat: strict types --- packages/language/res/stdlib.zmodel | 5 +++++ .../validators/attribute-application-validator.ts | 9 +++++++++ packages/orm/src/client/crud-types.ts | 12 ++++++++++-- packages/orm/src/client/zod/factory.ts | 4 +++- packages/schema/src/schema.ts | 1 + packages/sdk/src/ts-schema-generator.ts | 4 ++++ 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/packages/language/res/stdlib.zmodel b/packages/language/res/stdlib.zmodel index aa62891de..af22377ea 100644 --- a/packages/language/res/stdlib.zmodel +++ b/packages/language/res/stdlib.zmodel @@ -729,3 +729,8 @@ attribute @meta(_ name: String, _ value: Any) * Marks an attribute as deprecated. */ attribute @@@deprecated(_ message: String) + +/** + * Specifies a type def should not allow unknown fields. + */ +attribute @@strict() @@@once diff --git a/packages/language/src/validators/attribute-application-validator.ts b/packages/language/src/validators/attribute-application-validator.ts index d9568e9db..daaaf7b42 100644 --- a/packages/language/src/validators/attribute-application-validator.ts +++ b/packages/language/src/validators/attribute-application-validator.ts @@ -482,6 +482,15 @@ export default class AttributeApplicationValidator implements AstValidator, Partial > & - Record; + (IsTypeDefStrict extends true ? {} : Record); + +export type IsTypeDefStrict> = + Schema['typeDefs'] extends Record + ? Schema['typeDefs'][TypeDef]['strict'] extends true + ? true + : false + : never; export type BatchResult = { count: number }; @@ -1480,7 +1487,8 @@ type MapFieldDefType< T['type'] extends GetEnums ? keyof GetEnum : T['type'] extends GetTypeDefs - ? TypeDefResult & Record + ? TypeDefResult & + (IsTypeDefStrict extends true ? {} : Record) : MapBaseType, T['optional'], T['array'] diff --git a/packages/orm/src/client/zod/factory.ts b/packages/orm/src/client/zod/factory.ts index 322fa7721..d6a97bb1d 100644 --- a/packages/orm/src/client/zod/factory.ts +++ b/packages/orm/src/client/zod/factory.ts @@ -462,7 +462,9 @@ export class ZodSchemaFactory< private makeTypeDefSchema(type: string): ZodType { const typeDef = getTypeDef(this.schema, type); invariant(typeDef, `Type definition "${type}" not found in schema`); - const schema = z.looseObject( + const isStrict = typeDef.attributes?.some((attr) => attr.name === '@@strict') ?? false; + const func = isStrict ? z.strictObject : z.looseObject; + const schema = func( Object.fromEntries( Object.entries(typeDef.fields).map(([field, def]) => { // Wrap nested typedef references in z.lazy() so cyclic or self-referencing diff --git a/packages/schema/src/schema.ts b/packages/schema/src/schema.ts index 62e892203..3953ec724 100644 --- a/packages/schema/src/schema.ts +++ b/packages/schema/src/schema.ts @@ -129,6 +129,7 @@ export type EnumDef = { export type TypeDefDef = { name: string; + strict?: boolean; fields: Record; attributes?: readonly AttributeApplication[]; }; diff --git a/packages/sdk/src/ts-schema-generator.ts b/packages/sdk/src/ts-schema-generator.ts index cfa261ad5..34d50794e 100644 --- a/packages/sdk/src/ts-schema-generator.ts +++ b/packages/sdk/src/ts-schema-generator.ts @@ -538,6 +538,10 @@ export class TsSchemaGenerator { : []), ]; + if (hasAttribute(td, '@@strict')) { + fields.push(ts.factory.createPropertyAssignment('strict', ts.factory.createTrue())); + } + return ts.factory.createObjectLiteralExpression(fields, true); } From acc41414e8235fa10c72715d1708c032674a188c Mon Sep 17 00:00:00 2001 From: sanny-io Date: Fri, 7 Aug 2026 12:53:16 +0000 Subject: [PATCH 2/5] chore: add tests --- packages/cli/test/ts-schema-gen.test.ts | 21 +++++++ .../test/attribute-application.test.ts | 56 +++++++++++++++++++ tests/e2e/orm/client-api/procedures.test.ts | 28 ++++++++++ .../orm/client-api/typed-json-fields.test.ts | 34 +++++++++++ tests/e2e/orm/schemas/procedures/schema.ts | 27 +++++++++ .../e2e/orm/schemas/procedures/schema.zmodel | 8 +++ 6 files changed, 174 insertions(+) diff --git a/packages/cli/test/ts-schema-gen.test.ts b/packages/cli/test/ts-schema-gen.test.ts index 38a0e5cc6..f1abf7a92 100644 --- a/packages/cli/test/ts-schema-gen.test.ts +++ b/packages/cli/test/ts-schema-gen.test.ts @@ -736,4 +736,25 @@ model Post { plugins: {}, }); }); + + it('supports @@strict for type defs', async () => { + const { schema } = await generateTsSchema(` +model User { + id String @id @default(uuid()) + profile Profile? @json +} + +type Profile { + bio String + + @@strict +} + `); + + expect(schema.typeDefs).toMatchObject({ + Profile: { + strict: true, + }, + }); + }); }); diff --git a/packages/language/test/attribute-application.test.ts b/packages/language/test/attribute-application.test.ts index 3e74e2484..aaec9f987 100644 --- a/packages/language/test/attribute-application.test.ts +++ b/packages/language/test/attribute-application.test.ts @@ -816,4 +816,60 @@ describe('Attribute application validation tests', () => { /relation "bar" is not optional/, ); }); + + describe('@@strict attribute', () => { + it('accepts type defs', async () => { + await loadSchema(` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + + type Profile { + name String + + @@strict + } + `); + }); + + it('rejects non-type defs', async () => { + await loadSchemaWithError( + ` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + + model User { + id String @id + name String + + @@strict + } + `, + /attribute "@@strict" can only be used on type definitions/, + ); + + await loadSchemaWithError( + ` + datasource db { + provider = 'sqlite' + url = 'file:./dev.db' + } + + model User { + id String @id + } + + enum Enum { + TEST + + @@strict + } + `, + /attribute "@@strict" can only be used on type definitions/, + ); + }); + }); }); diff --git a/tests/e2e/orm/client-api/procedures.test.ts b/tests/e2e/orm/client-api/procedures.test.ts index 6bd7b5bfd..a92e1e87a 100644 --- a/tests/e2e/orm/client-api/procedures.test.ts +++ b/tests/e2e/orm/client-api/procedures.test.ts @@ -64,6 +64,18 @@ describe('Procedures tests', () => { return createdUsers; }); }, + + updateProfile: async ({ client, args: { userId, profile } }) => { + await client.user.update({ + data: { + profile, + }, + + where: { + id: userId, + }, + }); + }, }, }); }); @@ -214,4 +226,20 @@ describe('Procedures tests', () => { await expect(client.$procs.signUp({ args: { name: 'Alice' } })).rejects.toThrow(); await expect(client.user.count()).resolves.toBe(1); }); + + it('respects strict json', async () => { + const user = await client.$procs.signUp({ args: { name: 'Alice' } }); + await expect( + client.$procs.updateProfile({ + args: { + userId: user.id, + profile: { + bio: 'Programmer', + // @ts-expect-error + unknown: true, + }, + }, + }), + ).rejects.toThrow(/Unrecognized key: "unknown"/); + }); }); diff --git a/tests/e2e/orm/client-api/typed-json-fields.test.ts b/tests/e2e/orm/client-api/typed-json-fields.test.ts index f5a8945c1..56b83ed77 100644 --- a/tests/e2e/orm/client-api/typed-json-fields.test.ts +++ b/tests/e2e/orm/client-api/typed-json-fields.test.ts @@ -211,4 +211,38 @@ model User { }), ).rejects.toThrow(/invalid/i); }); + + it('rejects unknown fields when type is strict', async () => { + const schema = ` +type Profile { + name String + + @@strict +} + +model User { + id Int @id @default(autoincrement()) + profile Profile? @json +} + `; + + const client = await createTestClient(schema, { + usePrismaPush: true, + }); + + try { + await expect( + client.user.create({ + data: { + profile: { + name: 'Test', + unknown: true, + }, + }, + }), + ).rejects.toThrowError(/Unrecognized key: "unknown"/); + } finally { + await client.$disconnect(); + } + }); }); diff --git a/tests/e2e/orm/schemas/procedures/schema.ts b/tests/e2e/orm/schemas/procedures/schema.ts index b8261afe2..9b84da04c 100644 --- a/tests/e2e/orm/schemas/procedures/schema.ts +++ b/tests/e2e/orm/schemas/procedures/schema.ts @@ -32,6 +32,12 @@ export class SchemaType implements SchemaDef { type: "Role", attributes: [{ name: "@default", args: [{ name: "value", value: ExpressionUtils.literal("USER") }] }] as readonly AttributeApplication[], default: "USER" as FieldDefault + }, + profile: { + name: "profile", + type: "Profile", + optional: true, + attributes: [{ name: "@json" }] as readonly AttributeApplication[] } }, idFields: ["id"], @@ -65,6 +71,19 @@ export class SchemaType implements SchemaDef { optional: true } } + }, + Profile: { + name: "Profile", + fields: { + bio: { + name: "bio", + type: "String" + } + }, + attributes: [ + { name: "@@strict" } + ] as readonly AttributeApplication[], + strict: true } } as const; enums = { @@ -115,6 +134,14 @@ export class SchemaType implements SchemaDef { returnType: "User", returnArray: true, mutation: true + }, + updateProfile: { + params: { + userId: { name: "userId", type: "Int" }, + profile: { name: "profile", type: "Profile" } + }, + returnType: "Void", + mutation: true } } as const; plugins = {}; diff --git a/tests/e2e/orm/schemas/procedures/schema.zmodel b/tests/e2e/orm/schemas/procedures/schema.zmodel index 25380dab3..66f9c6804 100644 --- a/tests/e2e/orm/schemas/procedures/schema.zmodel +++ b/tests/e2e/orm/schemas/procedures/schema.zmodel @@ -15,10 +15,17 @@ type Overview { meta Json? } +type Profile { + bio String + + @@strict +} + model User { id Int @id @default(autoincrement()) name String @unique role Role @default(USER) + profile Profile? @json } procedure getUser(id: Int): User @@ -27,3 +34,4 @@ mutation procedure signUp(name: String, role: Role?): User mutation procedure setAdmin(userId: Int): Void procedure getOverview(): Overview mutation procedure createMultiple(names: String[]): User[] +mutation procedure updateProfile(userId: Int, profile: Profile): Void From 3adc94d85dc4c4a3f81a1d7a8ecf55cd6f482251 Mon Sep 17 00:00:00 2001 From: sanny-io Date: Fri, 7 Aug 2026 13:05:41 +0000 Subject: [PATCH 3/5] fix: check for boolean --- packages/orm/src/client/zod/factory.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/orm/src/client/zod/factory.ts b/packages/orm/src/client/zod/factory.ts index d6a97bb1d..0d335551a 100644 --- a/packages/orm/src/client/zod/factory.ts +++ b/packages/orm/src/client/zod/factory.ts @@ -462,8 +462,7 @@ export class ZodSchemaFactory< private makeTypeDefSchema(type: string): ZodType { const typeDef = getTypeDef(this.schema, type); invariant(typeDef, `Type definition "${type}" not found in schema`); - const isStrict = typeDef.attributes?.some((attr) => attr.name === '@@strict') ?? false; - const func = isStrict ? z.strictObject : z.looseObject; + const func = typeDef.strict ? z.strictObject : z.looseObject; const schema = func( Object.fromEntries( Object.entries(typeDef.fields).map(([field, def]) => { From c84d978091a573338fc9fd6226155d03f6c73cc2 Mon Sep 17 00:00:00 2001 From: sanny-io Date: Fri, 7 Aug 2026 15:08:45 +0000 Subject: [PATCH 4/5] chore: add more tests --- .../fetch-client/test/fetch-client.test.ts | 4 ++- .../test/schemas/basic/schema-lite.ts | 19 +++++++++-- .../test/schemas/basic/schema.zmodel | 8 ++++- .../test/schemas/no-procs/schema.ts | 33 +++++++++++++++++++ .../fetch-client/test/typing.test-d.ts | 16 +++++++++ .../test/react/react-typing.test-d.ts | 7 ++++ .../test/schemas/basic/schema-lite.ts | 22 ++++++++++++- .../test/schemas/basic/schema.zmodel | 30 ++++++++++------- .../test/svelte/svelte-typing-test.ts | 5 +++ .../test/vue/vue-typing-test.ts | 5 +++ 10 files changed, 132 insertions(+), 17 deletions(-) create mode 100644 packages/clients/fetch-client/test/schemas/no-procs/schema.ts diff --git a/packages/clients/fetch-client/test/fetch-client.test.ts b/packages/clients/fetch-client/test/fetch-client.test.ts index 0d155c53a..14e86a805 100644 --- a/packages/clients/fetch-client/test/fetch-client.test.ts +++ b/packages/clients/fetch-client/test/fetch-client.test.ts @@ -481,7 +481,9 @@ describe('createClient', () => { mockFetch.mockResolvedValue({ ok: true, text: async () => makeResponseText(true) }); const client = createClient(schema, { endpoint: ENDPOINT }); - const result = await (client as any).$procs.sendNotification.mutate({ args: { message: 'hello' } }); + const result = await (client as any).$procs.sendNotification.mutate({ + args: { notification: { message: 'hello' } }, + }); const [url, init] = mockFetch.mock.calls[0] ?? []; expect(url).toBe(`${ENDPOINT}/$procs/sendNotification`); diff --git a/packages/clients/fetch-client/test/schemas/basic/schema-lite.ts b/packages/clients/fetch-client/test/schemas/basic/schema-lite.ts index 39cbdc765..822e88692 100644 --- a/packages/clients/fetch-client/test/schemas/basic/schema-lite.ts +++ b/packages/clients/fetch-client/test/schemas/basic/schema-lite.ts @@ -5,7 +5,7 @@ /* eslint-disable */ -import { type SchemaDef, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema"; +import { type SchemaDef, type AttributeApplication, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema"; export class SchemaType implements SchemaDef { provider = { type: "sqlite" @@ -77,6 +77,21 @@ export class SchemaType implements SchemaDef { } } } as const; + typeDefs = { + Notification: { + name: "Notification", + fields: { + message: { + name: "message", + type: "String" + } + }, + attributes: [ + { name: "@@strict" } + ] as readonly AttributeApplication[], + strict: true + } + } as const; authType = "User" as const; procedures = { getStats: { @@ -85,7 +100,7 @@ export class SchemaType implements SchemaDef { }, sendNotification: { params: { - message: { name: "message", type: "String" } + notification: { name: "notification", type: "Notification" } }, returnType: "Boolean", mutation: true diff --git a/packages/clients/fetch-client/test/schemas/basic/schema.zmodel b/packages/clients/fetch-client/test/schemas/basic/schema.zmodel index 677819fe7..001c6795e 100644 --- a/packages/clients/fetch-client/test/schemas/basic/schema.zmodel +++ b/packages/clients/fetch-client/test/schemas/basic/schema.zmodel @@ -16,6 +16,12 @@ model Post { authorId String? } +type Notification { + message String + + @@strict +} + procedure getStats(): Int -mutation procedure sendNotification(message: String): Boolean +mutation procedure sendNotification(notification: Notification): Boolean diff --git a/packages/clients/fetch-client/test/schemas/no-procs/schema.ts b/packages/clients/fetch-client/test/schemas/no-procs/schema.ts new file mode 100644 index 000000000..7d64958c8 --- /dev/null +++ b/packages/clients/fetch-client/test/schemas/no-procs/schema.ts @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// DO NOT MODIFY THIS FILE // +// This file is automatically generated by ZenStack CLI and should not be manually updated. // +////////////////////////////////////////////////////////////////////////////////////////////// + +/* eslint-disable */ + +import { type SchemaDef, type AttributeApplication, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema"; +export class SchemaType implements SchemaDef { + provider = { + type: "sqlite" + } as const; + models = { + Item: { + name: "Item", + fields: { + id: { + name: "id", + type: "String", + id: true, + attributes: [{ name: "@id" }, { name: "@default", args: [{ name: "value", value: ExpressionUtils.call("cuid") }] }] as readonly AttributeApplication[], + default: ExpressionUtils.call("cuid") as FieldDefault + } + }, + idFields: ["id"], + uniqueFields: { + id: { type: "String" } + } + } + } as const; + plugins = {}; +} +export const schema = new SchemaType(); diff --git a/packages/clients/fetch-client/test/typing.test-d.ts b/packages/clients/fetch-client/test/typing.test-d.ts index 882bc0908..1df90827f 100644 --- a/packages/clients/fetch-client/test/typing.test-d.ts +++ b/packages/clients/fetch-client/test/typing.test-d.ts @@ -217,3 +217,19 @@ describe('Extended result fields (ExtResult)', () => { }; }); }); + +describe('Custom types', () => { + it('supports @@strict', () => { + const client = createClient(schema, { endpoint: ENDPOINT }); + + client.$procs.sendNotification.mutate({ + args: { + notification: { + message: 'test', + // @ts-expect-error known properties + unknown: true, + }, + }, + }); + }); +}); diff --git a/packages/clients/tanstack-query/test/react/react-typing.test-d.ts b/packages/clients/tanstack-query/test/react/react-typing.test-d.ts index 6008ad878..fffef35eb 100644 --- a/packages/clients/tanstack-query/test/react/react-typing.test-d.ts +++ b/packages/clients/tanstack-query/test/react/react-typing.test-d.ts @@ -127,6 +127,13 @@ describe('React client typing test', () => { client.foo.useUpdate(); client.bar.useCreate(); + + client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer' } } }); + + // @ts-expect-error known properties + client.user + .useCreate() + .mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); }); it('reflects ExtQueryArgs and ExtResult inferred from a ClientContract type', () => { diff --git a/packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts b/packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts index 4ea2da51e..1f88ef758 100644 --- a/packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts +++ b/packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts @@ -5,7 +5,7 @@ /* eslint-disable */ -import { type SchemaDef, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema"; +import { type SchemaDef, type AttributeApplication, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema"; export class SchemaType implements SchemaDef { provider = { type: "sqlite" @@ -35,6 +35,11 @@ export class SchemaType implements SchemaDef { type: "Post", array: true, relation: { opposite: "owner" } + }, + profile: { + name: "profile", + type: "Profile", + optional: true } }, idFields: ["id"], @@ -166,6 +171,21 @@ export class SchemaType implements SchemaDef { } } } as const; + typeDefs = { + Profile: { + name: "Profile", + fields: { + bio: { + name: "bio", + type: "String" + } + }, + attributes: [ + { name: "@@strict" } + ] as readonly AttributeApplication[], + strict: true + } + } as const; authType = "User" as const; plugins = {}; } diff --git a/packages/clients/tanstack-query/test/schemas/basic/schema.zmodel b/packages/clients/tanstack-query/test/schemas/basic/schema.zmodel index d274e95c5..3e4aeb1d6 100644 --- a/packages/clients/tanstack-query/test/schemas/basic/schema.zmodel +++ b/packages/clients/tanstack-query/test/schemas/basic/schema.zmodel @@ -3,29 +3,30 @@ datasource db { } model User { - id String @id @default(cuid()) - email String @unique - name String? - posts Post[] + id String @id @default(cuid()) + email String @unique + name String? + posts Post[] + profile Profile? @json } model Post { - id String @id @default(cuid()) - title String - owner User? @relation(fields: [ownerId], references: [id]) - ownerId String? - category Category? @relation(fields: [categoryId], references: [id]) + id String @id @default(cuid()) + title String + owner User? @relation(fields: [ownerId], references: [id]) + ownerId String? + category Category? @relation(fields: [categoryId], references: [id]) categoryId String? } model Category { - id String @id @default(cuid()) - name String @unique + id String @id @default(cuid()) + name String @unique posts Post[] } model Foo { - id String @id @default(cuid()) + id String @id @default(cuid()) type String @@delegate(type) } @@ -33,3 +34,8 @@ model Foo { model Bar extends Foo { title String } + +type Profile { + bio String + @@strict +} diff --git a/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts b/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts index a2c83887b..97ace9a77 100644 --- a/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts +++ b/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts @@ -68,6 +68,11 @@ client.user data: { email: 'test@example.com' }, }); +client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer' } } }); + +// @ts-expect-error known properties +client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); + client.user .useCreate() .mutateAsync({ data: { email: 'test@example.com' }, include: { posts: true } }) diff --git a/packages/clients/tanstack-query/test/vue/vue-typing-test.ts b/packages/clients/tanstack-query/test/vue/vue-typing-test.ts index e72f90445..fd1d57cde 100644 --- a/packages/clients/tanstack-query/test/vue/vue-typing-test.ts +++ b/packages/clients/tanstack-query/test/vue/vue-typing-test.ts @@ -66,6 +66,11 @@ client.user .mutateAsync({ data: { email: 'test@example.com' }, include: { posts: true } }) .then((d) => check(d.posts[0]?.title)); +client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer' } } }); + +// @ts-expect-error known properties +client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); + client.user .useCreateMany() .mutateAsync({ From 6f4cb315c7b7bca099a774c27955c316bf42bac7 Mon Sep 17 00:00:00 2001 From: sanny-io Date: Fri, 7 Aug 2026 15:16:29 +0000 Subject: [PATCH 5/5] chore: fix formatting --- .../tanstack-query/test/react/react-typing.test-d.ts | 2 +- .../tanstack-query/test/svelte/svelte-typing-test.ts | 6 ++++-- packages/clients/tanstack-query/test/vue/vue-typing-test.ts | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/clients/tanstack-query/test/react/react-typing.test-d.ts b/packages/clients/tanstack-query/test/react/react-typing.test-d.ts index fffef35eb..b6538017a 100644 --- a/packages/clients/tanstack-query/test/react/react-typing.test-d.ts +++ b/packages/clients/tanstack-query/test/react/react-typing.test-d.ts @@ -130,9 +130,9 @@ describe('React client typing test', () => { client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer' } } }); - // @ts-expect-error known properties client.user .useCreate() + // @ts-expect-error known properties .mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); }); diff --git a/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts b/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts index 97ace9a77..9ff48e578 100644 --- a/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts +++ b/packages/clients/tanstack-query/test/svelte/svelte-typing-test.ts @@ -70,8 +70,10 @@ client.user client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer' } } }); -// @ts-expect-error known properties -client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); +client.user + .useCreate() + // @ts-expect-error known properties + .mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); client.user .useCreate() diff --git a/packages/clients/tanstack-query/test/vue/vue-typing-test.ts b/packages/clients/tanstack-query/test/vue/vue-typing-test.ts index fd1d57cde..ec118eda5 100644 --- a/packages/clients/tanstack-query/test/vue/vue-typing-test.ts +++ b/packages/clients/tanstack-query/test/vue/vue-typing-test.ts @@ -68,8 +68,10 @@ client.user client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer' } } }); -// @ts-expect-error known properties -client.user.useCreate().mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); +client.user + .useCreate() + // @ts-expect-error known properties + .mutate({ data: { email: 'test@example.com', profile: { bio: 'Programmer', unknown: true } } }); client.user .useCreateMany()