Skip to content

Commit

Permalink
Remove redundant fields from custom-id example (#8763)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Cousens <[email protected]>
  • Loading branch information
Josh Calder and dcousens committed Aug 15, 2023
1 parent 48328c1 commit ef7b29d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .changeset/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Greenheart",
"JedWatson",
"MadeByMike",
"MarcelMalik",
"Meetcpatel",
"MohammadKurjieh",
"MurzNN",
Expand All @@ -17,6 +18,7 @@
"Skulek",
"TasinIshmam",
"Tekipeps",
"TweededBadger",
"Vultraz",
"acburdine",
"adamjkb",
Expand Down
28 changes: 0 additions & 28 deletions examples/custom-id/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@
type Task {
id: ID!
label: String
priority: TaskPriorityType
isComplete: Boolean
assignedTo: Person
finishBy: DateTime
}

enum TaskPriorityType {
low
medium
high
}

scalar DateTime @specifiedBy(url: "https://datatracker.ietf.org/doc/html/rfc3339#section-5.6")

input TaskWhereUniqueInput {
Expand All @@ -28,8 +20,6 @@ input TaskWhereInput {
NOT: [TaskWhereInput!]
id: IDFilter
label: StringFilter
priority: TaskPriorityTypeNullableFilter
isComplete: BooleanFilter
assignedTo: PersonWhereInput
finishBy: DateTimeNullableFilter
}
Expand Down Expand Up @@ -73,18 +63,6 @@ input NestedStringFilter {
not: NestedStringFilter
}

input TaskPriorityTypeNullableFilter {
equals: TaskPriorityType
in: [TaskPriorityType!]
notIn: [TaskPriorityType!]
not: TaskPriorityTypeNullableFilter
}

input BooleanFilter {
equals: Boolean
not: BooleanFilter
}

input DateTimeNullableFilter {
equals: DateTime
in: [DateTime!]
Expand All @@ -99,8 +77,6 @@ input DateTimeNullableFilter {
input TaskOrderByInput {
id: OrderDirection
label: OrderDirection
priority: OrderDirection
isComplete: OrderDirection
finishBy: OrderDirection
}

Expand All @@ -111,8 +87,6 @@ enum OrderDirection {

input TaskUpdateInput {
label: String
priority: TaskPriorityType
isComplete: Boolean
assignedTo: PersonRelateToOneForUpdateInput
finishBy: DateTime
}
Expand All @@ -130,8 +104,6 @@ input TaskUpdateArgs {

input TaskCreateInput {
label: String
priority: TaskPriorityType
isComplete: Boolean
assignedTo: PersonRelateToOneForCreateInput
finishBy: DateTime
}
Expand Down
2 changes: 0 additions & 2 deletions examples/custom-id/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ generator client {
model Task {
id Int @id @default(autoincrement())
label String @default("")
priority String?
isComplete Boolean @default(false)
assignedTo Person? @relation("Task_assignedTo", fields: [assignedToId], references: [id])
assignedToId String? @map("assignedTo")
finishBy DateTime?
Expand Down
12 changes: 1 addition & 11 deletions examples/custom-id/schema.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { list } from '@keystone-6/core';
import { allowAll } from '@keystone-6/core/access';
import { checkbox, relationship, text, timestamp } from '@keystone-6/core/fields';
import { select } from '@keystone-6/core/fields';
import { relationship, text, timestamp } from '@keystone-6/core/fields';
import { createId } from '@paralleldrive/cuid2';
import type { Lists } from '.keystone/types';

Expand All @@ -17,15 +16,6 @@ export const lists: Lists = {
},
fields: {
label: text({ validation: { isRequired: true } }),
priority: select({
type: 'enum',
options: [
{ label: 'Low', value: 'low' },
{ label: 'Medium', value: 'medium' },
{ label: 'High', value: 'high' },
],
}),
isComplete: checkbox(),
assignedTo: relationship({ ref: 'Person.tasks', many: false }),
finishBy: timestamp(),
},
Expand Down

0 comments on commit ef7b29d

Please sign in to comment.