diff --git a/packages/prisma/test/bobbin.spec.ts b/packages/prisma/test/bobbin.spec.ts index d47aec1..15989bb 100644 --- a/packages/prisma/test/bobbin.spec.ts +++ b/packages/prisma/test/bobbin.spec.ts @@ -214,7 +214,13 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Query { + "type User { + id: ID! + email: String! + name: String + } + + type Query { countUser(where: UserWhereInput!): Int! } @@ -265,16 +271,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Query { - findFirstUser(where: UserWhereInput): User - } - - type User { + "type User { id: ID! email: String! name: String } + type Query { + findFirstUser(where: UserWhereInput): User + } + input UserWhereInput { name: String! }" @@ -323,16 +329,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Query { - findManyUser(where: UserWhereInput): [User!]! - } - - type User { + "type User { id: ID! email: String! name: String } + type Query { + findManyUser(where: UserWhereInput): [User!]! + } + input UserWhereInput { name: String! }" @@ -381,16 +387,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Query { - findUniqueUser(where: UserWhereInput!): User - } - - type User { + "type User { id: ID! email: String! name: String } + type Query { + findUniqueUser(where: UserWhereInput!): User + } + input UserWhereInput { id: Float! }" @@ -439,16 +445,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { - createUser(data: UserCreateInput!): User - } - - type User { + "type User { id: ID! email: String! name: String } + type Mutation { + createUser(data: UserCreateInput!): User + } + input UserCreateInput { email: String! }" @@ -494,7 +500,13 @@ describe("PrismaModelBobbin", () => { }) const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { + "type User { + id: ID! + email: String! + name: String + } + + type Mutation { createManyUser(data: [UserCreateManyInput!]!): BatchPayload } @@ -549,16 +561,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { - deleteUser(where: UserDeleteInput!): User - } - - type User { + "type User { id: ID! email: String! name: String } + type Mutation { + deleteUser(where: UserDeleteInput!): User + } + input UserDeleteInput { email: String! }" @@ -605,7 +617,13 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { + "type User { + id: ID! + email: String! + name: String + } + + type Mutation { deleteManyUser(where: UserDeleteManyInput!): BatchPayload } @@ -666,16 +684,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { - updateUser(data: UserUpdateInput!, where: UserWhereInput!): User! - } - - type User { + "type User { id: ID! email: String! name: String } + type Mutation { + updateUser(data: UserUpdateInput!, where: UserWhereInput!): User! + } + input UserUpdateInput { email: String! } @@ -733,7 +751,13 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { + "type User { + id: ID! + email: String! + name: String + } + + type Mutation { updateManyUser(data: UserUpdateManyInput!, where: UserWhereInput!): BatchPayload } @@ -799,16 +823,16 @@ describe("PrismaModelBobbin", () => { const schema = weave(r) expect(printSchema(schema)).toMatchInlineSnapshot(` - "type Mutation { - upsertUser(where: UserWhereUniqueInput!, create: UserUpsertInput!, update: UserUpsertInput!): User! - } - - type User { + "type User { id: ID! email: String! name: String } + type Mutation { + upsertUser(where: UserWhereUniqueInput!, create: UserUpsertInput!, update: UserUpsertInput!): User! + } + input UserWhereUniqueInput { email: String! } diff --git a/packages/valibot/test/schema.spec.ts b/packages/valibot/test/schema.spec.ts index 424e869..7020fa8 100644 --- a/packages/valibot/test/schema.spec.ts +++ b/packages/valibot/test/schema.spec.ts @@ -145,12 +145,12 @@ describe("", () => { }) expect(printResolver(r)).toMatchInlineSnapshot(` - "type Query { - dog: Dog! + "type Dog { + name: String } - type Dog { - name: String + type Query { + dog: Dog! }" `) }) @@ -348,11 +348,7 @@ describe("", () => { }) expect(printResolver(r)).toMatchInlineSnapshot(` - "type Query { - orange: Orange! - } - - type Orange implements Fruit { + "type Orange implements Fruit { name: String! color: String! prize: Float! @@ -362,6 +358,10 @@ describe("", () => { name: String! color: String! prize: Float! + } + + type Query { + orange: Orange! }" `) }) @@ -482,15 +482,15 @@ describe("", () => { }), }) expect(printResolver(r1, r2)).toMatchInlineSnapshot(` - "type Query { - dog: Dog! - } - - type Dog { + "type Dog { name: String! birthday: String! age: Float! greeting: String! + } + + type Query { + dog: Dog! }" `) }) @@ -533,7 +533,13 @@ describe("", () => { }) expect(printResolver(r1)).toMatchInlineSnapshot(` - "type Query { + "type Dog { + name: String! + birthday: String! + age: Float! + } + + type Query { dog: Dog cat: Cat! dogs: [Dog]! @@ -541,12 +547,6 @@ describe("", () => { mustDogs: [Dog!]! } - type Dog { - name: String! - birthday: String! - age: Float! - } - type Cat { name: String! birthday: String! @@ -582,12 +582,7 @@ describe("", () => { }) expect(printResolver(r)).toMatchInlineSnapshot(` - "type Query { - orange: Orange! - apple: Apple! - } - - type Orange { + "type Orange { name: String! color: String! prize: Prize! @@ -598,6 +593,11 @@ describe("", () => { value: Float! } + type Query { + orange: Orange! + apple: Apple! + } + type Apple { name: String! color: String! @@ -642,12 +642,7 @@ describe("", () => { }) expect(printResolver(r)).toMatchInlineSnapshot(` - "type Query { - orange: Orange! - apple: Apple! - } - - type Orange implements Fruit { + "type Orange implements Fruit { name: String! color: String! prize: Prize! @@ -664,6 +659,11 @@ describe("", () => { value: Float! } + type Query { + orange: Orange! + apple: Apple! + } + type Apple implements Fruit { name: String! color: String! @@ -717,19 +717,19 @@ describe("", () => { }) expect(printResolver(r1)).toMatchInlineSnapshot(` - "type Query { + "type Dog { + name: String! + birthday: String! + age: Float! + } + + type Query { unwrap(name: String!, birthday: String!): Dog! dog(data: DogInput!): Dog! dogs(data: [DogInput!]!, required: [DogInput!]!, names: [String!]!): [Dog!]! mustDog(data: DataInput!): Dog! } - type Dog { - name: String! - birthday: String! - age: Float! - } - input DogInput { name: String! birthday: String! diff --git a/packages/yup/test/schema.spec.ts b/packages/yup/test/schema.spec.ts index 8e2088e..c095920 100644 --- a/packages/yup/test/schema.spec.ts +++ b/packages/yup/test/schema.spec.ts @@ -118,12 +118,12 @@ describe("YupWeaver", () => { }) expect(printResolver(r)).toMatchInlineSnapshot(` - "type Query { - dog: Dog + "type Dog { + name: String } - type Dog { - name: String + type Query { + dog: Dog }" `) }) @@ -432,15 +432,15 @@ describe("YupWeaver", () => { }) expect(printResolver(r1, r2)).toMatchInlineSnapshot(` - "type Query { - dog: Dog - } - - type Dog { + "type Dog { name: String! birthday: String! age: Float greeting: String + } + + type Query { + dog: Dog }" `) }) @@ -470,17 +470,17 @@ describe("YupWeaver", () => { }) expect(printResolver(r1)).toMatchInlineSnapshot(` - "type Query { + "type Dog { + name: String! + birthday: String! + age: Float + } + + type Query { dog: Dog dogs: [Dog] mustDog: Dog! mustDogs: [Dog!] - } - - type Dog { - name: String! - birthday: String! - age: Float }" `) }) @@ -522,20 +522,20 @@ describe("YupWeaver", () => { }) expect(printResolver(r1)).toMatchInlineSnapshot(` - "type Query { - unwrap(name: String!, birthday: String!): Dog - dog(data: DogInput): Dog - dogs(data: [DogInput], required: [DogInput!], names: [String!]!): [Dog!] - mustDog(data: DogInput!): Dog! - } - - """Dog Type""" + """"Dog Type""" type Dog { name: String! birthday: String! age: Float } + type Query { + unwrap(name: String!, birthday: String!): Dog + dog(data: DogInput): Dog + dogs(data: [DogInput], required: [DogInput!], names: [String!]!): [Dog!] + mustDog(data: DogInput!): Dog! + } + """Dog Type""" input DogInput { name: String! diff --git a/packages/zod/test/schema.spec.ts b/packages/zod/test/schema.spec.ts index 15264ca..4320838 100644 --- a/packages/zod/test/schema.spec.ts +++ b/packages/zod/test/schema.spec.ts @@ -149,12 +149,12 @@ describe("ZodSilk", () => { }) expect(printResolver(r)).toMatchInlineSnapshot(` - "type Query { - dog: Dog! + "type Dog { + name: String } - type Dog { - name: String + type Query { + dog: Dog! }" `) }) @@ -475,15 +475,15 @@ describe("ZodSilk", () => { }), }) expect(printResolver(r1, r2)).toMatchInlineSnapshot(` - "type Query { - dog: Dog! - } - - type Dog { + "type Dog { name: String! birthday: String! age: Float! greeting: String! + } + + type Query { + dog: Dog! }" `) }) @@ -515,17 +515,17 @@ describe("ZodSilk", () => { }) expect(printResolver(r1)).toMatchInlineSnapshot(` - "type Query { + "type Dog { + name: String! + birthday: String! + age: Float! + } + + type Query { dog: Dog dogs: [Dog]! mustDog: Dog! mustDogs: [Dog!]! - } - - type Dog { - name: String! - birthday: String! - age: Float! }" `) }) @@ -584,7 +584,14 @@ describe("ZodSilk", () => { }) expect(printResolver(r1)).toMatchInlineSnapshot(` - "type Query { + """"Does the dog love fish?""" + type Dog { + name: String! + birthday: String + age: Float! + } + + type Query { unwrap(name: String!, birthday: String): Dog! dog( """Does the dog love fish?""" @@ -594,13 +601,6 @@ describe("ZodSilk", () => { mustDog(data: DataInput!): DogRequired! } - """Does the dog love fish?""" - type Dog { - name: String! - birthday: String - age: Float! - } - """Does the dog love fish?""" input DogInput { name: String!