Skip to content

Commit

Permalink
New id fields (keystonejs#5947)
Browse files Browse the repository at this point in the history
* Id field experimenting

* word

* Try a different default to see what our tests do

* Update things

* snapshots

* Update things

* Remove a thing

* field view

* Fix ts errors

* WIP

* Fix a thing

* Fix more tests

* Fix things

* Fix more things

* More fixes

* Reorder a thing so the failing output is easy to debug

* Try a thing

* Update schemas

* Tests

* Update docs

* Add uuid dep

* Changeset

* Words

* Add another changeset

* Some more tests and cuid change

* Update docs/pages/docs/apis/config.mdx

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>

* Update docs/pages/docs/apis/config.mdx

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>

* Update .changeset/eight-lions-stare.md

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
  • Loading branch information
2 people authored and Nikitoring committed Sep 14, 2021
1 parent f9b7ff3 commit ccd729a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples-staging/playground/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ input NoteWhereInput {
id_lte: ID
id_gt: ID
id_gte: ID
id_in: [ID]
id_not_in: [ID]
id_in: [ID!]
id_not_in: [ID!]
label: String
label_not: String
label_contains: String
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/playground/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ generator client {
}

model Note {
id Int @id @default(autoincrement())
id String @id @default(cuid())
label String?
}
8 changes: 4 additions & 4 deletions examples/document-field/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ input PostWhereInput {
id_lte: ID
id_gt: ID
id_gte: ID
id_in: [ID]
id_not_in: [ID]
id_in: [ID!]
id_not_in: [ID!]
title: String
title_not: String
title_contains: String
Expand Down Expand Up @@ -173,8 +173,8 @@ input AuthorWhereInput {
id_lte: ID
id_gt: ID
id_gte: ID
id_in: [ID]
id_not_in: [ID]
id_in: [ID!]
id_not_in: [ID!]
name: String
name_not: String
name_contains: String
Expand Down
6 changes: 3 additions & 3 deletions examples/document-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ generator client {
}

model Post {
id Int @id @default(autoincrement())
id String @id @default(cuid())
title String?
slug String? @unique
status String?
content String?
publishDate DateTime?
author Author? @relation("Post_author", fields: [authorId], references: [id])
authorId Int? @map("author")
authorId String? @map("author")
@@index([authorId])
}

model Author {
id Int @id @default(autoincrement())
id String @id @default(cuid())
name String?
email String? @unique
posts Post[] @relation("Post_author")
Expand Down
8 changes: 4 additions & 4 deletions examples/testing/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ input TaskWhereInput {
id_lte: ID
id_gt: ID
id_gte: ID
id_in: [ID]
id_not_in: [ID]
id_in: [ID!]
id_not_in: [ID!]
label: String
label_not: String
label_contains: String
Expand Down Expand Up @@ -162,8 +162,8 @@ input PersonWhereInput {
id_lte: ID
id_gt: ID
id_gte: ID
id_in: [ID]
id_not_in: [ID]
id_in: [ID!]
id_not_in: [ID!]
name: String
name_not: String
name_contains: String
Expand Down
6 changes: 3 additions & 3 deletions examples/testing/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ generator client {
}

model Task {
id Int @id @default(autoincrement())
id String @id @default(cuid())
label String?
priority String?
isComplete Boolean?
assignedTo Person? @relation("Task_assignedTo", fields: [assignedToId], references: [id])
assignedToId Int? @map("assignedTo")
assignedToId String? @map("assignedTo")
finishBy DateTime?
@@index([assignedToId])
}

model Person {
id Int @id @default(autoincrement())
id String @id @default(cuid())
name String?
email String? @unique
password String?
Expand Down

0 comments on commit ccd729a

Please sign in to comment.