Skip to content

Commit

Permalink
add defaulted fields to test too
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Nov 25, 2024
1 parent 7c4bd4b commit b516f25
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
15 changes: 15 additions & 0 deletions examples/number-fields/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
type Example {
id: ID!
bigInt: BigInt
bigIntDefaulted: BigInt
float: Float
floatDefaulted: Float
integer: Int
integerDefaulted: Int
}

scalar BigInt
Expand All @@ -20,8 +23,11 @@ input ExampleWhereInput {
NOT: [ExampleWhereInput!]
id: IDFilter
bigInt: BigIntNullableFilter
bigIntDefaulted: BigIntNullableFilter
float: FloatNullableFilter
floatDefaulted: FloatNullableFilter
integer: IntNullableFilter
integerDefaulted: IntNullableFilter
}

input IDFilter {
Expand Down Expand Up @@ -71,8 +77,11 @@ input IntNullableFilter {
input ExampleOrderByInput {
id: OrderDirection
bigInt: OrderDirection
bigIntDefaulted: OrderDirection
float: OrderDirection
floatDefaulted: OrderDirection
integer: OrderDirection
integerDefaulted: OrderDirection
}

enum OrderDirection {
Expand All @@ -82,8 +91,11 @@ enum OrderDirection {

input ExampleUpdateInput {
bigInt: BigInt
bigIntDefaulted: BigInt
float: Float
floatDefaulted: Float
integer: Int
integerDefaulted: Int
}

input ExampleUpdateArgs {
Expand All @@ -93,8 +105,11 @@ input ExampleUpdateArgs {

input ExampleCreateInput {
bigInt: BigInt
bigIntDefaulted: BigInt
float: Float
floatDefaulted: Float
integer: Int
integerDefaulted: Int
}

"""
Expand Down
11 changes: 7 additions & 4 deletions examples/number-fields/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ generator client {
}

model Example {
id String @id @default(cuid())
bigInt BigInt?
float Float?
integer Int?
id String @id @default(cuid())
bigInt BigInt?
bigIntDefaulted BigInt? @default(123)
float Float?
floatDefaulted Float? @default(456.321)
integer Int?
integerDefaulted Int? @default(789)
}
3 changes: 3 additions & 0 deletions examples/number-fields/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ export const lists = {
access: allowAll,
fields: {
bigInt: bigInt(),
bigIntDefaulted: bigInt({ defaultValue: 123n }),
float: float(),
floatDefaulted: float({ defaultValue: 456.321 }),
integer: integer(),
integerDefaulted: integer({ defaultValue: 789 }),
},
}),
} satisfies Lists

0 comments on commit b516f25

Please sign in to comment.