diff --git a/examples/blog/README.md b/examples/blog/README.md index 7cf371339..360fcc5eb 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -7,10 +7,8 @@ docker run --detach --publish 5432:5432 -e POSTGRES_PASSWORD=postgres --name 'ne ``` ``` -yarn -s prisma migrate save --experimental -yarn -s prisma migrate up --experimental yarn -s prisma generate -yarn -s ts-node prisma/seed.ts +yarn -s prisma migrate reset --preview-feature ``` ``` diff --git a/examples/blog/package.json b/examples/blog/package.json index 7dd268a62..f12752e9e 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -8,25 +8,25 @@ "build": "yarn -s clean && yarn -s generate && tsc", "style": "prettier --write 'src/**/*'", "dev": "ts-node-dev --tree-kill --no-notify --respawn --transpile-only src/main.ts", - "dev:migrate": "prisma migrate save --experimental -c && prisma migrate up --experimental -c", + "dev:migrate": "prisma migrate dev --preview-feature", "generate": "yarn -s generate:prisma && yarn -s generate:nexus", "generate:prisma": "prisma generate", "generate:nexus": "NODE_ENV=development ts-node --transpile-only src/schema", "data:inject": "ts-node prisma/fake-data.ts" }, "dependencies": { - "@prisma/client": "2.16.0", + "@prisma/client": "2.17.0", "graphql": "^15.4.0", "graphql-yoga": "^1.18.2", "nexus": "^1.0.0", - "nexus-plugin-prisma": "^0.29.0" + "nexus-plugin-prisma": "^0.30.0" }, "devDependencies": { "@types/faker": "^5.1.5", "@types/ws": "^7.4.0", "faker": "^5.1.0", "prettier": "^2.2.1", - "prisma": "^2.16.0", + "prisma": "^2.17.0", "ts-node": "^9.1.1", "ts-node-dev": "^1.1.1", "typescript": "^4.1.3" diff --git a/examples/blog/prisma/migrations/20200429160229-init/README.md b/examples/blog/prisma/migrations/20200429160229-init/README.md deleted file mode 100644 index e1608830c..000000000 --- a/examples/blog/prisma/migrations/20200429160229-init/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# Migration `20200429160229-init` - -This migration has been generated by Jason Kuhrt at 4/29/2020, 4:02:29 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TYPE "UserRole" AS ENUM ('ADMIN', 'AUTHOR'); - -CREATE TYPE "PostStatus" AS ENUM ('DRAFT', 'PUBLISHED'); - -CREATE TABLE "public"."Blog" ( - "createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "id" SERIAL, - "name" text NOT NULL , - "updatedAt" timestamp(3) NOT NULL , - "viewCount" integer NOT NULL DEFAULT 0, - PRIMARY KEY ("id") -) - -CREATE TABLE "public"."User" ( - "blogId" integer , - "createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "id" SERIAL, - "name" text , - "rating" Decimal(65,30) NOT NULL , - "role" "UserRole" NOT NULL , - "updatedAt" timestamp(3) NOT NULL , - PRIMARY KEY ("id") -) - -CREATE TABLE "public"."Post" ( - "blogId" integer , - "id" SERIAL, - "status" "PostStatus" NOT NULL , - "title" text NOT NULL , - "userId" integer , - PRIMARY KEY ("id") -) - -CREATE TABLE "public"."Tag" ( - "id" SERIAL, - "postId" integer , - "value" text NOT NULL , - PRIMARY KEY ("id") -) - -ALTER TABLE "public"."User" ADD FOREIGN KEY ("blogId")REFERENCES "public"."Blog"("id") ON DELETE SET NULL ON UPDATE CASCADE - -ALTER TABLE "public"."Post" ADD FOREIGN KEY ("blogId")REFERENCES "public"."Blog"("id") ON DELETE SET NULL ON UPDATE CASCADE - -ALTER TABLE "public"."Post" ADD FOREIGN KEY ("userId")REFERENCES "public"."User"("id") ON DELETE SET NULL ON UPDATE CASCADE - -ALTER TABLE "public"."Tag" ADD FOREIGN KEY ("postId")REFERENCES "public"."Post"("id") ON DELETE SET NULL ON UPDATE CASCADE -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration ..20200429160229-init ---- datamodel.dml -+++ datamodel.dml -@@ -1,0 +1,58 @@ -+datasource db { -+ provider = "postgresql" -+ url = "postgresql://postgres:postgres@localhost:5432/myapp" -+} -+ -+generator prisma_client { -+ provider = "prisma-client-js" -+} -+ -+model Blog { -+ id Int @default(autoincrement()) @id -+ createdAt DateTime @default(now()) -+ updatedAt DateTime @updatedAt -+ name String -+ viewCount Int @default(0) -+ posts Post[] -+ authors User[] -+} -+ -+model User { -+ id Int @default(autoincrement()) @id -+ createdAt DateTime @default(now()) -+ updatedAt DateTime @updatedAt -+ name String? -+ posts Post[] -+ blogId Int? -+ blog Blog? @relation(fields: [blogId], references: [id]) -+ rating Float -+ role UserRole -+} -+ -+enum UserRole { -+ ADMIN -+ AUTHOR -+} -+ -+model Post { -+ id Int @default(autoincrement()) @id -+ title String -+ tags Tag[] -+ blogId Int? -+ blog Blog? @relation(fields: [blogId], references: [id]) -+ status PostStatus -+ userId Int? -+ user User? @relation(fields: [userId], references: [id]) -+} -+ -+enum PostStatus { -+ DRAFT -+ PUBLISHED -+} -+ -+model Tag { -+ id Int @default(autoincrement()) @id -+ value String -+ postId Int? -+ post Post? @relation(fields: [postId], references: [id]) -+} -``` - - diff --git a/examples/blog/prisma/migrations/20200429160229-init/schema.prisma b/examples/blog/prisma/migrations/20200429160229-init/schema.prisma deleted file mode 100644 index 3cdf7c8e1..000000000 --- a/examples/blog/prisma/migrations/20200429160229-init/schema.prisma +++ /dev/null @@ -1,58 +0,0 @@ -datasource db { - provider = "postgresql" - url = "***" -} - -generator prisma_client { - provider = "prisma-client-js" -} - -model Blog { - id Int @default(autoincrement()) @id - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - name String - viewCount Int @default(0) - posts Post[] - authors User[] -} - -model User { - id Int @default(autoincrement()) @id - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - name String? - posts Post[] - blogId Int? - blog Blog? @relation(fields: [blogId], references: [id]) - rating Float - role UserRole -} - -enum UserRole { - ADMIN - AUTHOR -} - -model Post { - id Int @default(autoincrement()) @id - title String - tags Tag[] - blogId Int? - blog Blog? @relation(fields: [blogId], references: [id]) - status PostStatus - userId Int? - user User? @relation(fields: [userId], references: [id]) -} - -enum PostStatus { - DRAFT - PUBLISHED -} - -model Tag { - id Int @default(autoincrement()) @id - value String - postId Int? - post Post? @relation(fields: [postId], references: [id]) -} diff --git a/examples/blog/prisma/migrations/20200429160229-init/steps.json b/examples/blog/prisma/migrations/20200429160229-init/steps.json deleted file mode 100644 index 3efd1d168..000000000 --- a/examples/blog/prisma/migrations/20200429160229-init/steps.json +++ /dev/null @@ -1,652 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateEnum", - "enum": "UserRole", - "values": [ - "ADMIN", - "AUTHOR" - ] - }, - { - "tag": "CreateEnum", - "enum": "PostStatus", - "values": [ - "DRAFT", - "PUBLISHED" - ] - }, - { - "tag": "CreateSource", - "source": "db" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Source", - "source": "db" - }, - "argument": "provider", - "value": "\"postgresql\"" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Source", - "source": "db" - }, - "argument": "url", - "value": "\"postgresql://postgres:postgres@localhost:5432/myapp\"" - }, - { - "tag": "CreateModel", - "model": "Blog" - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "id", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Blog", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Blog", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "autoincrement()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Blog", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Blog", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Blog", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Blog", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "name", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "viewCount", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Blog", - "field": "viewCount" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Blog", - "field": "viewCount" - }, - "directive": "default" - }, - "argument": "", - "value": "0" - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "posts", - "type": "Post", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "Blog", - "field": "authors", - "type": "User", - "arity": "List" - }, - { - "tag": "CreateModel", - "model": "User" - }, - { - "tag": "CreateField", - "model": "User", - "field": "id", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "autoincrement()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "User", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateField", - "model": "User", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "User", - "field": "name", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "User", - "field": "posts", - "type": "Post", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "User", - "field": "blogId", - "type": "Int", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "User", - "field": "blog", - "type": "Blog", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "blog" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "blog" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[blogId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "blog" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "User", - "field": "rating", - "type": "Float", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "User", - "field": "role", - "type": "UserRole", - "arity": "Required" - }, - { - "tag": "CreateModel", - "model": "Post" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "id", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "autoincrement()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "Post", - "field": "title", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "tags", - "type": "Tag", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "blogId", - "type": "Int", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "blog", - "type": "Blog", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "blog" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "blog" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[blogId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "blog" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "status", - "type": "PostStatus", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "userId", - "type": "Int", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "user", - "type": "User", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "user" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "user" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[userId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "user" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateModel", - "model": "Tag" - }, - { - "tag": "CreateField", - "model": "Tag", - "field": "id", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Tag", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Tag", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "autoincrement()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Tag", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "Tag", - "field": "value", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Tag", - "field": "postId", - "type": "Int", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Tag", - "field": "post", - "type": "Post", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Tag", - "field": "post" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Tag", - "field": "post" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[postId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Tag", - "field": "post" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - } - ] -} \ No newline at end of file diff --git a/examples/blog/prisma/migrations/20210217093310_init/migration.sql b/examples/blog/prisma/migrations/20210217093310_init/migration.sql new file mode 100644 index 000000000..c9e5c6c91 --- /dev/null +++ b/examples/blog/prisma/migrations/20210217093310_init/migration.sql @@ -0,0 +1,61 @@ +-- CreateEnum +CREATE TYPE "UserRole" AS ENUM ('ADMIN', 'AUTHOR'); + +-- CreateEnum +CREATE TYPE "PostStatus" AS ENUM ('DRAFT', 'PUBLISHED'); + +-- CreateTable +CREATE TABLE "Blog" ( + "id" SERIAL NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "name" TEXT NOT NULL, + "viewCount" INTEGER NOT NULL DEFAULT 0, + + PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" SERIAL NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "name" TEXT, + "blogId" INTEGER, + "rating" DOUBLE PRECISION NOT NULL, + "role" "UserRole" NOT NULL, + + PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Post" ( + "id" SERIAL NOT NULL, + "title" TEXT NOT NULL, + "blogId" INTEGER, + "status" "PostStatus" NOT NULL, + "userId" INTEGER, + + PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Tag" ( + "id" SERIAL NOT NULL, + "value" TEXT NOT NULL, + "postId" INTEGER, + + PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "User" ADD FOREIGN KEY ("blogId") REFERENCES "Blog"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Post" ADD FOREIGN KEY ("blogId") REFERENCES "Blog"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Post" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Tag" ADD FOREIGN KEY ("postId") REFERENCES "Post"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/examples/blog/prisma/migrations/migrate.lock b/examples/blog/prisma/migrations/migrate.lock deleted file mode 100644 index 1d6a5c861..000000000 --- a/examples/blog/prisma/migrations/migrate.lock +++ /dev/null @@ -1,6 +0,0 @@ -# IF THERE'S A GIT CONFLICT IN THIS FILE, DON'T SOLVE IT MANUALLY! -# INSTEAD EXECUTE `prisma migrate fix` -# Prisma Migrate lockfile v1 -# Read more about conflict resolution here: TODO - -20200429160229-init \ No newline at end of file diff --git a/examples/blog/prisma/migrations/migration_lock.toml b/examples/blog/prisma/migrations/migration_lock.toml new file mode 100644 index 000000000..fbffa92c2 --- /dev/null +++ b/examples/blog/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" \ No newline at end of file diff --git a/examples/blog/prisma/schema.prisma b/examples/blog/prisma/schema.prisma index 825e4ee5a..8630fd362 100644 --- a/examples/blog/prisma/schema.prisma +++ b/examples/blog/prisma/schema.prisma @@ -8,7 +8,7 @@ generator prisma_client { } model Blog { - id Int @default(autoincrement()) @id + id Int @id @default(autoincrement()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt name String @@ -18,7 +18,7 @@ model Blog { } model User { - id Int @default(autoincrement()) @id + id Int @id @default(autoincrement()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt name String? @@ -35,7 +35,7 @@ enum UserRole { } model Post { - id Int @default(autoincrement()) @id + id Int @id @default(autoincrement()) title String tags Tag[] blogId Int? @@ -51,7 +51,7 @@ enum PostStatus { } model Tag { - id Int @default(autoincrement()) @id + id Int @id @default(autoincrement()) value String postId Int? post Post? @relation(fields: [postId], references: [id]) diff --git a/examples/blog/prisma/seed.ts b/examples/blog/prisma/seed.ts index 35782cd63..a85fe73d1 100644 --- a/examples/blog/prisma/seed.ts +++ b/examples/blog/prisma/seed.ts @@ -28,5 +28,5 @@ async function main() { }) console.log('added blog with author:\n', blogWithAuthor) - await prisma.disconnect() + await prisma.$disconnect() } diff --git a/examples/blog/yarn.lock b/examples/blog/yarn.lock index 4aeaf1b03..8c47cece4 100644 --- a/examples/blog/yarn.lock +++ b/examples/blog/yarn.lock @@ -2,22 +2,22 @@ # yarn lockfile v1 -"@prisma/client@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.16.0.tgz#811dcb8310544876b88a0bbd230a2f65c58a9c01" - integrity sha512-q02/IKwUIN+9Kl+Oayfb6x38NQ4ROvLoPSE+V0DRlJehTAJoxgRUWuPwaiOkksVnnmK4XHvKS/TR5EmQHUVxYw== +"@prisma/client@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.17.0.tgz#e38462796c2e824504763416f5e3a7219d70652d" + integrity sha512-tzsBxtx9J1epOGCiBeXur1tEz81UIdWg2G/HpDmflXKcv/MJb+KCWSKSsEW49eXcvVwRgxNyxLoCO6CwvjQKcg== dependencies: - "@prisma/engines-version" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" + "@prisma/engines-version" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" -"@prisma/engines-version@2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1": - version "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1.tgz#6df1a9a9f4c711e18861be2de4c4f0e363d0aae9" - integrity sha512-/gcqWJDXoo0vsYi7fhdhdyjfMXxJPjKl8K7oc/k2BH7IQuXUB1A+ZnFgqRcT/rKuyU4xH8+N+l+C4boWlqYvgQ== +"@prisma/engines-version@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223": + version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#9ae6ed4467a0febff8afaf216c1bb67225f51b84" + integrity sha512-9idv5blqPUlvUPVT48eVi3T0RS/NBklUcjrla3jWyV8AYfB2BdaG/Zci7H5ajyYLnfZZHG9tBpP0LcveQCFH8A== -"@prisma/engines@2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1": - version "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1.tgz#c7a53f31eafca0e4c010663740ee22ea678f757e" - integrity sha512-vt8w+vqCEaTUGZes7mrY5BkF3zZIPTQ9x+C9Ynmr9d+WW54vTqJt7lDFS6eps0LYoqdcCHEs3r/SydCqjII+OQ== +"@prisma/engines@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223": + version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#08bc3633fd27fb1935805ef16c37802ed713db5b" + integrity sha512-FKjVD6NYbGiQhwas3hA2uMpNchz+Mf3tv5qA8Ci9cAkKHGqt3jWjjUAK9juVBqeOcv4OPimQYMrkRX6SvaxBjg== "@types/aws-lambda@8.10.13": version "8.10.13" @@ -1048,10 +1048,10 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -nexus-plugin-prisma@^0.29.0: - version "0.29.0" - resolved "https://registry.yarnpkg.com/nexus-plugin-prisma/-/nexus-plugin-prisma-0.29.0.tgz#a0a30346d93bb86812677bc47a52486aa621c7c1" - integrity sha512-NwHFTwSPdShGPjS9qqN71iiJwHVIE3lxOdHeYzU3oti1eNWsSMh4oiLZ2KDd7tKjlZ5nKHaYZfCqQVgqlfAc8g== +nexus-plugin-prisma@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/nexus-plugin-prisma/-/nexus-plugin-prisma-0.30.0.tgz#6860328ee09c80f16bbc359864415b8358084111" + integrity sha512-/Slypcty4fLVnN8k0ifsav0zY/xHWHzBpCboAmLs3eINxy++oYNUurpEv9C1dJ/2kTOBGSE1kpWMYt1SjUyHNg== dependencies: camelcase "^6.2.0" endent "^2.0.1" @@ -1187,12 +1187,12 @@ prettier@^2.2.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== -prisma@^2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-2.16.0.tgz#a4d3d82932f8aa4b4c5415d254bd9966ed9b5c33" - integrity sha512-tV+28U0dfmuC0lRWZlqI3PLx+5U2UFw4h5fikBexglXsMOE60S732UDnQPOKS/wztJE7EDS36lk6FInFVDpkPQ== +prisma@^2.17.0: + version "2.17.0" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-2.17.0.tgz#686469914ed13d4b0926ee5f17efb7a9ab741e8a" + integrity sha512-NypJI7OCXCfDkRKubbVb3nmPeRJ1SjQfg6QAwK06KsreBZl1F96rFz2iB2bl4kIrhLAbIySBjwUJlG87Jsxt7g== dependencies: - "@prisma/engines" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" + "@prisma/engines" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" proxy-addr@~2.0.5: version "2.0.6" diff --git a/examples/hello-world/README.md b/examples/hello-world/README.md index 47fe5f85d..70f6496cf 100644 --- a/examples/hello-world/README.md +++ b/examples/hello-world/README.md @@ -7,10 +7,8 @@ docker run --detach --publish 5432:5432 -e POSTGRES_PASSWORD=postgres --name 'ne ``` ``` -yarn -s prisma migrate save --experimental -yarn -s prisma migrate up --experimental yarn -s prisma generate -yarn -s ts-node prisma/seed.ts +yarn -s prisma migrate reset --preview-feature ``` ``` diff --git a/examples/hello-world/package.json b/examples/hello-world/package.json index 0d7126689..a6399f88d 100644 --- a/examples/hello-world/package.json +++ b/examples/hello-world/package.json @@ -10,17 +10,17 @@ "nexus:reflect": "NEXUS_SHOULD_EXIT_AFTER_GENERATE_ARTIFACTS=true ts-node --transpile-only api" }, "dependencies": { - "@prisma/client": "^2.16.0", + "@prisma/client": "^2.17.0", "apollo-server-express": "^2.19.1", "express": "^4.17.1", "graphql": "^15.4.0", "graphql-scalars": "^1.7.0", "nexus": "^1.0.0", - "nexus-plugin-prisma": "^0.29.0" + "nexus-plugin-prisma": "^0.30.0" }, "devDependencies": { "@types/express": "^4.17.9", - "prisma": "^2.16.0", + "prisma": "^2.17.0", "ts-node": "^9.1.1", "ts-node-dev": "^1.1.1", "typescript": "^4.1.3" diff --git a/examples/hello-world/prisma/schema.prisma b/examples/hello-world/prisma/schema.prisma index b86c16082..04b05a53a 100644 --- a/examples/hello-world/prisma/schema.prisma +++ b/examples/hello-world/prisma/schema.prisma @@ -8,7 +8,7 @@ generator prisma_client { } model User { - id String @default(cuid()) @id + id String @id @default(cuid()) email String @unique birthDate DateTime metadata Json @@ -16,6 +16,6 @@ model User { } model Post { - id String @default(cuid()) @id + id String @id @default(cuid()) authors User[] @relation(references: [id]) } diff --git a/examples/hello-world/prisma/seed.ts b/examples/hello-world/prisma/seed.ts index be64aad74..ec2f4add2 100644 --- a/examples/hello-world/prisma/seed.ts +++ b/examples/hello-world/prisma/seed.ts @@ -7,15 +7,19 @@ async function seed() { data: { email: 'foo@bar.com', birthDate: new Date(), + metadata: {}, posts: { - create: [{}, {}], + create: [ + { title: 'post 1', status: 'DRAFT' }, + { title: 'post 2', status: 'DRAFT' }, + ], }, }, }) console.log(res) - await prisma.disconnect() + await prisma.$disconnect() } seed() diff --git a/examples/hello-world/schema.graphql b/examples/hello-world/schema.graphql index 6ac10e383..7569e25ce 100644 --- a/examples/hello-world/schema.graphql +++ b/examples/hello-world/schema.graphql @@ -63,17 +63,17 @@ type Post { } input PostCreateInput { - authors: UserCreateManyWithoutPostsInput + authors: UserCreateNestedManyWithoutPostsInput id: String } -input PostCreateManyWithoutAuthorsInput { +input PostCreateNestedManyWithoutAuthorsInput { connect: [PostWhereUniqueInput!] - connectOrCreate: [PostCreateOrConnectWithoutauthorsInput!] + connectOrCreate: [PostCreateOrConnectWithoutAuthorsInput!] create: [PostCreateWithoutAuthorsInput!] } -input PostCreateOrConnectWithoutauthorsInput { +input PostCreateOrConnectWithoutAuthorsInput { create: PostCreateWithoutAuthorsInput! where: PostWhereUniqueInput! } @@ -150,16 +150,16 @@ input UserCreateInput { email: String! id: String metadata: Json! - posts: PostCreateManyWithoutAuthorsInput + posts: PostCreateNestedManyWithoutAuthorsInput } -input UserCreateManyWithoutPostsInput { +input UserCreateNestedManyWithoutPostsInput { connect: [UserWhereUniqueInput!] - connectOrCreate: [UserCreateOrConnectWithoutpostsInput!] + connectOrCreate: [UserCreateOrConnectWithoutPostsInput!] create: [UserCreateWithoutPostsInput!] } -input UserCreateOrConnectWithoutpostsInput { +input UserCreateOrConnectWithoutPostsInput { create: UserCreateWithoutPostsInput! where: UserWhereUniqueInput! } diff --git a/examples/hello-world/yarn.lock b/examples/hello-world/yarn.lock index 24fd7b1ed..dfdf567d0 100644 --- a/examples/hello-world/yarn.lock +++ b/examples/hello-world/yarn.lock @@ -35,22 +35,22 @@ dependencies: xss "^1.0.6" -"@prisma/client@^2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.16.0.tgz#811dcb8310544876b88a0bbd230a2f65c58a9c01" - integrity sha512-q02/IKwUIN+9Kl+Oayfb6x38NQ4ROvLoPSE+V0DRlJehTAJoxgRUWuPwaiOkksVnnmK4XHvKS/TR5EmQHUVxYw== +"@prisma/client@^2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.17.0.tgz#e38462796c2e824504763416f5e3a7219d70652d" + integrity sha512-tzsBxtx9J1epOGCiBeXur1tEz81UIdWg2G/HpDmflXKcv/MJb+KCWSKSsEW49eXcvVwRgxNyxLoCO6CwvjQKcg== dependencies: - "@prisma/engines-version" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" + "@prisma/engines-version" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" -"@prisma/engines-version@2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1": - version "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1.tgz#6df1a9a9f4c711e18861be2de4c4f0e363d0aae9" - integrity sha512-/gcqWJDXoo0vsYi7fhdhdyjfMXxJPjKl8K7oc/k2BH7IQuXUB1A+ZnFgqRcT/rKuyU4xH8+N+l+C4boWlqYvgQ== +"@prisma/engines-version@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223": + version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#9ae6ed4467a0febff8afaf216c1bb67225f51b84" + integrity sha512-9idv5blqPUlvUPVT48eVi3T0RS/NBklUcjrla3jWyV8AYfB2BdaG/Zci7H5ajyYLnfZZHG9tBpP0LcveQCFH8A== -"@prisma/engines@2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1": - version "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1.tgz#c7a53f31eafca0e4c010663740ee22ea678f757e" - integrity sha512-vt8w+vqCEaTUGZes7mrY5BkF3zZIPTQ9x+C9Ynmr9d+WW54vTqJt7lDFS6eps0LYoqdcCHEs3r/SydCqjII+OQ== +"@prisma/engines@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223": + version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#08bc3633fd27fb1935805ef16c37802ed713db5b" + integrity sha512-FKjVD6NYbGiQhwas3hA2uMpNchz+Mf3tv5qA8Ci9cAkKHGqt3jWjjUAK9juVBqeOcv4OPimQYMrkRX6SvaxBjg== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -1361,10 +1361,10 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -nexus-plugin-prisma@^0.29.0: - version "0.29.0" - resolved "https://registry.yarnpkg.com/nexus-plugin-prisma/-/nexus-plugin-prisma-0.29.0.tgz#a0a30346d93bb86812677bc47a52486aa621c7c1" - integrity sha512-NwHFTwSPdShGPjS9qqN71iiJwHVIE3lxOdHeYzU3oti1eNWsSMh4oiLZ2KDd7tKjlZ5nKHaYZfCqQVgqlfAc8g== +nexus-plugin-prisma@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/nexus-plugin-prisma/-/nexus-plugin-prisma-0.30.0.tgz#6860328ee09c80f16bbc359864415b8358084111" + integrity sha512-/Slypcty4fLVnN8k0ifsav0zY/xHWHzBpCboAmLs3eINxy++oYNUurpEv9C1dJ/2kTOBGSE1kpWMYt1SjUyHNg== dependencies: camelcase "^6.2.0" endent "^2.0.1" @@ -1529,12 +1529,12 @@ pluralize@^8.0.0: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== -prisma@^2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-2.16.0.tgz#a4d3d82932f8aa4b4c5415d254bd9966ed9b5c33" - integrity sha512-tV+28U0dfmuC0lRWZlqI3PLx+5U2UFw4h5fikBexglXsMOE60S732UDnQPOKS/wztJE7EDS36lk6FInFVDpkPQ== +prisma@^2.17.0: + version "2.17.0" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-2.17.0.tgz#686469914ed13d4b0926ee5f17efb7a9ab741e8a" + integrity sha512-NypJI7OCXCfDkRKubbVb3nmPeRJ1SjQfg6QAwK06KsreBZl1F96rFz2iB2bl4kIrhLAbIySBjwUJlG87Jsxt7g== dependencies: - "@prisma/engines" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" + "@prisma/engines" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" proxy-addr@~2.0.5: version "2.0.6" diff --git a/package.json b/package.json index 2203f73d8..427e3304e 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "upgrade-prisma-dev": "yarn add @prisma/cli@dev @prisma/client@dev @prisma/fetch-engine@dev @prisma/get-platform@dev @prisma/migrate@dev @prisma/sdk@dev" }, "peerDependencies": { - "@prisma/client": "2.16.x", + "@prisma/client": "2.17.x", "graphql": "^15.3.0", "nexus": "^1.0.0" }, @@ -46,11 +46,11 @@ }, "devDependencies": { "@prisma-labs/prettier-config": "0.1.0", - "@prisma/client": "2.16.0", - "@prisma/fetch-engine": "2.16.0", - "@prisma/get-platform": "2.16.0", - "@prisma/migrate": "2.16.0", - "@prisma/sdk": "2.16.0", + "@prisma/client": "2.17.0", + "@prisma/fetch-engine": "2.17.0", + "@prisma/get-platform": "2.17.0", + "@prisma/migrate": "2.17.0", + "@prisma/sdk": "2.17.0", "@types/jest": "26.0.20", "@types/lodash": "4.14.167", "@types/node": "14.14.20", diff --git a/tests/__app/generated/nexus-typegen.d.ts b/tests/__app/generated/nexus-typegen.d.ts index 067da31d3..21fbae845 100644 --- a/tests/__app/generated/nexus-typegen.d.ts +++ b/tests/__app/generated/nexus-typegen.d.ts @@ -25,10 +25,10 @@ export interface NexusGenInputs { } BubbleCreateNestedOneWithoutMembersInput: { // input type connect?: NexusGenInputs['BubbleWhereUniqueInput'] | null; // BubbleWhereUniqueInput - connectOrCreate?: NexusGenInputs['BubbleCreateOrConnectWithoutmembersInput'] | null; // BubbleCreateOrConnectWithoutmembersInput + connectOrCreate?: NexusGenInputs['BubbleCreateOrConnectWithoutMembersInput'] | null; // BubbleCreateOrConnectWithoutMembersInput create?: NexusGenInputs['BubbleCreateWithoutMembersInput'] | null; // BubbleCreateWithoutMembersInput } - BubbleCreateOrConnectWithoutmembersInput: { // input type + BubbleCreateOrConnectWithoutMembersInput: { // input type create: NexusGenInputs['BubbleCreateWithoutMembersInput']; // BubbleCreateWithoutMembersInput! where: NexusGenInputs['BubbleWhereUniqueInput']; // BubbleWhereUniqueInput! } @@ -266,10 +266,10 @@ export interface NexusGenInputs { } UserCreateNestedManyWithoutPostsInput: { // input type connect?: NexusGenInputs['UserWhereUniqueInput'][] | null; // [UserWhereUniqueInput!] - connectOrCreate?: NexusGenInputs['UserCreateOrConnectWithoutpostsInput'][] | null; // [UserCreateOrConnectWithoutpostsInput!] + connectOrCreate?: NexusGenInputs['UserCreateOrConnectWithoutPostsInput'][] | null; // [UserCreateOrConnectWithoutPostsInput!] create?: NexusGenInputs['UserCreateWithoutPostsInput'][] | null; // [UserCreateWithoutPostsInput!] } - UserCreateOrConnectWithoutpostsInput: { // input type + UserCreateOrConnectWithoutPostsInput: { // input type create: NexusGenInputs['UserCreateWithoutPostsInput']; // UserCreateWithoutPostsInput! where: NexusGenInputs['UserWhereUniqueInput']; // UserWhereUniqueInput! } diff --git a/tests/__app/generated/schema.graphql b/tests/__app/generated/schema.graphql index ebc41b83a..f93dfb0b0 100644 --- a/tests/__app/generated/schema.graphql +++ b/tests/__app/generated/schema.graphql @@ -19,11 +19,11 @@ type Bubble { input BubbleCreateNestedOneWithoutMembersInput { connect: BubbleWhereUniqueInput - connectOrCreate: BubbleCreateOrConnectWithoutmembersInput + connectOrCreate: BubbleCreateOrConnectWithoutMembersInput create: BubbleCreateWithoutMembersInput } -input BubbleCreateOrConnectWithoutmembersInput { +input BubbleCreateOrConnectWithoutMembersInput { create: BubbleCreateWithoutMembersInput! where: BubbleWhereUniqueInput! } @@ -340,11 +340,11 @@ type User { input UserCreateNestedManyWithoutPostsInput { connect: [UserWhereUniqueInput!] - connectOrCreate: [UserCreateOrConnectWithoutpostsInput!] + connectOrCreate: [UserCreateOrConnectWithoutPostsInput!] create: [UserCreateWithoutPostsInput!] } -input UserCreateOrConnectWithoutpostsInput { +input UserCreateOrConnectWithoutPostsInput { create: UserCreateWithoutPostsInput! where: UserWhereUniqueInput! } diff --git a/tests/__snapshots__/app.test.ts.snap b/tests/__snapshots__/app.test.ts.snap index e1c6fc538..3eeb40fd0 100644 --- a/tests/__snapshots__/app.test.ts.snap +++ b/tests/__snapshots__/app.test.ts.snap @@ -20,11 +20,11 @@ type Bubble { input BubbleCreateNestedOneWithoutMembersInput { connect: BubbleWhereUniqueInput - connectOrCreate: BubbleCreateOrConnectWithoutmembersInput + connectOrCreate: BubbleCreateOrConnectWithoutMembersInput create: BubbleCreateWithoutMembersInput } -input BubbleCreateOrConnectWithoutmembersInput { +input BubbleCreateOrConnectWithoutMembersInput { create: BubbleCreateWithoutMembersInput! where: BubbleWhereUniqueInput! } @@ -341,11 +341,11 @@ type User { input UserCreateNestedManyWithoutPostsInput { connect: [UserWhereUniqueInput!] - connectOrCreate: [UserCreateOrConnectWithoutpostsInput!] + connectOrCreate: [UserCreateOrConnectWithoutPostsInput!] create: [UserCreateWithoutPostsInput!] } -input UserCreateOrConnectWithoutpostsInput { +input UserCreateOrConnectWithoutPostsInput { create: UserCreateWithoutPostsInput! where: UserWhereUniqueInput! } @@ -5461,13 +5461,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "PostCreateOrConnectWithoutauthorsInput", + "type": "PostCreateOrConnectWithoutAuthorsInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "PostCreateOrConnectWithoutauthorsInput", + "type": "PostCreateOrConnectWithoutAuthorsInput", }, ], "isNullable": false, @@ -5581,7 +5581,7 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "BubbleCreateOrConnectWithoutmembersInput", + "type": "BubbleCreateOrConnectWithoutMembersInput", }, ], "isNullable": false, @@ -5647,13 +5647,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "PostCreateOrConnectWithoutauthorsInput", + "type": "PostCreateOrConnectWithoutAuthorsInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "PostCreateOrConnectWithoutauthorsInput", + "type": "PostCreateOrConnectWithoutAuthorsInput", }, ], "isNullable": false, @@ -5932,7 +5932,7 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "BubbleCreateOrConnectWithoutmembersInput", + "type": "BubbleCreateOrConnectWithoutMembersInput", }, ], "isNullable": false, @@ -6149,13 +6149,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, ], "isNullable": false, @@ -6227,13 +6227,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, ], "isNullable": false, @@ -6305,13 +6305,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, ], "isNullable": false, @@ -6516,13 +6516,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutlocationInput", + "type": "UserCreateOrConnectWithoutLocationInput", }, ], "isNullable": false, @@ -6727,13 +6727,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutpostsInput", + "type": "UserCreateOrConnectWithoutPostsInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutpostsInput", + "type": "UserCreateOrConnectWithoutPostsInput", }, ], "isNullable": false, @@ -6896,13 +6896,13 @@ Object { "isList": false, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutpostsInput", + "type": "UserCreateOrConnectWithoutPostsInput", }, Object { "isList": true, "location": "inputObjectTypes", "namespace": "prisma", - "type": "UserCreateOrConnectWithoutpostsInput", + "type": "UserCreateOrConnectWithoutPostsInput", }, ], "isNullable": false, @@ -8426,7 +8426,7 @@ Object { "name": "create", }, ], - "name": "PostCreateOrConnectWithoutauthorsInput", + "name": "PostCreateOrConnectWithoutAuthorsInput", }, Object { "constraints": Object { @@ -8676,7 +8676,7 @@ Object { "name": "create", }, ], - "name": "BubbleCreateOrConnectWithoutmembersInput", + "name": "BubbleCreateOrConnectWithoutMembersInput", }, Object { "constraints": Object { @@ -9453,7 +9453,7 @@ Object { "name": "create", }, ], - "name": "UserCreateOrConnectWithoutlocationInput", + "name": "UserCreateOrConnectWithoutLocationInput", }, Object { "constraints": Object { @@ -9781,7 +9781,7 @@ Object { "name": "create", }, ], - "name": "UserCreateOrConnectWithoutpostsInput", + "name": "UserCreateOrConnectWithoutPostsInput", }, Object { "constraints": Object { @@ -11808,36 +11808,6 @@ Object { "type": "AggregateBubble", }, }, - Object { - "args": Array [ - Object { - "inputTypes": Array [ - Object { - "isList": false, - "location": "inputObjectTypes", - "namespace": "prisma", - "type": "BubbleWhereUniqueInput", - }, - ], - "isNullable": false, - "isRequired": true, - "name": "where", - }, - ], - "deprecation": Object { - "plannedRemovalVersion": "2.15", - "reason": "The \`findOne\` query has been deprecated and replaced with \`findUnique\`.", - "sinceVersion": "2.14", - }, - "isNullable": true, - "name": "findOneBubble", - "outputType": Object { - "isList": false, - "location": "outputObjectTypes", - "namespace": "model", - "type": "Bubble", - }, - }, Object { "args": Array [ Object { @@ -12132,36 +12102,6 @@ Object { "type": "AggregateUser", }, }, - Object { - "args": Array [ - Object { - "inputTypes": Array [ - Object { - "isList": false, - "location": "inputObjectTypes", - "namespace": "prisma", - "type": "UserWhereUniqueInput", - }, - ], - "isNullable": false, - "isRequired": true, - "name": "where", - }, - ], - "deprecation": Object { - "plannedRemovalVersion": "2.15", - "reason": "The \`findOne\` query has been deprecated and replaced with \`findUnique\`.", - "sinceVersion": "2.14", - }, - "isNullable": true, - "name": "findOneUser", - "outputType": Object { - "isList": false, - "location": "outputObjectTypes", - "namespace": "model", - "type": "User", - }, - }, Object { "args": Array [ Object { @@ -12456,36 +12396,6 @@ Object { "type": "AggregateLocation", }, }, - Object { - "args": Array [ - Object { - "inputTypes": Array [ - Object { - "isList": false, - "location": "inputObjectTypes", - "namespace": "prisma", - "type": "LocationWhereUniqueInput", - }, - ], - "isNullable": false, - "isRequired": true, - "name": "where", - }, - ], - "deprecation": Object { - "plannedRemovalVersion": "2.15", - "reason": "The \`findOne\` query has been deprecated and replaced with \`findUnique\`.", - "sinceVersion": "2.14", - }, - "isNullable": true, - "name": "findOneLocation", - "outputType": Object { - "isList": false, - "location": "outputObjectTypes", - "namespace": "model", - "type": "Location", - }, - }, Object { "args": Array [ Object { @@ -12780,36 +12690,6 @@ Object { "type": "AggregatePost", }, }, - Object { - "args": Array [ - Object { - "inputTypes": Array [ - Object { - "isList": false, - "location": "inputObjectTypes", - "namespace": "prisma", - "type": "PostWhereUniqueInput", - }, - ], - "isNullable": false, - "isRequired": true, - "name": "where", - }, - ], - "deprecation": Object { - "plannedRemovalVersion": "2.15", - "reason": "The \`findOne\` query has been deprecated and replaced with \`findUnique\`.", - "sinceVersion": "2.14", - }, - "isNullable": true, - "name": "findOnePost", - "outputType": Object { - "isList": false, - "location": "outputObjectTypes", - "namespace": "model", - "type": "Post", - }, - }, Object { "args": Array [ Object { diff --git a/tests/schema/__snapshots__/computedInputs.test.ts.snap b/tests/schema/__snapshots__/computedInputs.test.ts.snap index b37fd31fe..b41448ffa 100644 --- a/tests/schema/__snapshots__/computedInputs.test.ts.snap +++ b/tests/schema/__snapshots__/computedInputs.test.ts.snap @@ -50,7 +50,7 @@ input NestedCreateNestedManyWithoutUserInput { input UserCreateNestedOneWithoutNestedInput { create: UserCreateWithoutNestedInput - connectOrCreate: UserCreateOrConnectWithoutnestedInput + connectOrCreate: UserCreateOrConnectWithoutNestedInput connect: UserWhereUniqueInput } @@ -67,7 +67,7 @@ input UserCreateWithoutNestedInput { name: String! } -input UserCreateOrConnectWithoutnestedInput { +input UserCreateOrConnectWithoutNestedInput { where: UserWhereUniqueInput! create: UserCreateWithoutNestedInput! } diff --git a/yarn.lock b/yarn.lock index 233dc5a40..600773b8e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -680,30 +680,30 @@ resolved "https://registry.yarnpkg.com/@prisma-labs/prettier-config/-/prettier-config-0.1.0.tgz#ef6cb5f89487974ca997516e9b39d5ccbefeeaad" integrity sha512-P0h2y+gnIxFP2HdsTYSYHWmabGBlxyVjnUepsrRe8gAF36mxOonGsbsQmKt/Q9H9CMjrSkFoDe5F5HLi2iW5/Q== -"@prisma/client@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.16.0.tgz#811dcb8310544876b88a0bbd230a2f65c58a9c01" - integrity sha512-q02/IKwUIN+9Kl+Oayfb6x38NQ4ROvLoPSE+V0DRlJehTAJoxgRUWuPwaiOkksVnnmK4XHvKS/TR5EmQHUVxYw== +"@prisma/client@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.17.0.tgz#e38462796c2e824504763416f5e3a7219d70652d" + integrity sha512-tzsBxtx9J1epOGCiBeXur1tEz81UIdWg2G/HpDmflXKcv/MJb+KCWSKSsEW49eXcvVwRgxNyxLoCO6CwvjQKcg== dependencies: - "@prisma/engines-version" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" + "@prisma/engines-version" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" -"@prisma/debug@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-2.16.0.tgz#27a322db0191f70c33077c31b800587787a7b86c" - integrity sha512-XcUzFlL5ciIIlYZ3U/pAJhU/2UCEOvb45lzynKDDYI+D2C64CFDeyeSrLiotYNF52NQKO3SkK46VLQEEDYLVTQ== +"@prisma/debug@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/debug/-/debug-2.17.0.tgz#0caa176d5c81e6cf1ad71c5da5e5796f4cb621ae" + integrity sha512-ZKjPqOhtSQUPJMmGQJT+XU3cmGzljgdAcJrXb5TcwEPSznUhsuCcC6MItbJ6QB+n1Aeeg3kK0CniRBlF8ZGw4A== dependencies: debug "4.3.2" ms "^2.1.3" -"@prisma/engine-core@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/engine-core/-/engine-core-2.16.0.tgz#f18d410ef198dd8e2f9e1fdab78d32206f508de9" - integrity sha512-yWJOuDd9XxeDhTKYjMHSVEhOsTrvidvaf1t0jhsDal1TCto+PZZyQNBLXSr1Or+pbg03yy7V891pcbByVOyXzg== +"@prisma/engine-core@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/engine-core/-/engine-core-2.17.0.tgz#c37c8d66d34c030a53c5bd172179c00ea79560ec" + integrity sha512-AVOCq+Mn4HISp8h4nle3ip3K8hnC7ns83pJSslozblAJILvPZ62fEee30aM3jWClnNGEIkfChB2qbe8lDELCBw== dependencies: - "@prisma/debug" "2.16.0" - "@prisma/engines" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - "@prisma/generator-helper" "2.16.0" - "@prisma/get-platform" "2.16.0" + "@prisma/debug" "2.17.0" + "@prisma/engines" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + "@prisma/generator-helper" "2.17.0" + "@prisma/get-platform" "2.17.0" chalk "^4.0.0" execa "^5.0.0" get-stream "^6.0.0" @@ -711,25 +711,30 @@ new-github-issue-url "^0.2.1" p-retry "^4.2.0" terminal-link "^2.1.1" - undici "3.2.0" + undici "3.3.3" -"@prisma/engines-version@2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1": - version "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1.tgz#6df1a9a9f4c711e18861be2de4c4f0e363d0aae9" - integrity sha512-/gcqWJDXoo0vsYi7fhdhdyjfMXxJPjKl8K7oc/k2BH7IQuXUB1A+ZnFgqRcT/rKuyU4xH8+N+l+C4boWlqYvgQ== +"@prisma/engines-version@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223": + version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#9ae6ed4467a0febff8afaf216c1bb67225f51b84" + integrity sha512-9idv5blqPUlvUPVT48eVi3T0RS/NBklUcjrla3jWyV8AYfB2BdaG/Zci7H5ajyYLnfZZHG9tBpP0LcveQCFH8A== "@prisma/engines@2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1": version "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1.tgz#c7a53f31eafca0e4c010663740ee22ea678f757e" integrity sha512-vt8w+vqCEaTUGZes7mrY5BkF3zZIPTQ9x+C9Ynmr9d+WW54vTqJt7lDFS6eps0LYoqdcCHEs3r/SydCqjII+OQ== -"@prisma/fetch-engine@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-2.16.0.tgz#5455a03a72e8ae120fd11e3b5a325e9e53e08d86" - integrity sha512-1YKmdMnZ9WhkK92pbPJHfYPCeaKlnlYqUA9z6VCiOpLZY3EnpSl/PijZ/4Hkm/KOCxov0eepMGXAL/lNYz3SzQ== +"@prisma/engines@2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223": + version "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223.tgz#08bc3633fd27fb1935805ef16c37802ed713db5b" + integrity sha512-FKjVD6NYbGiQhwas3hA2uMpNchz+Mf3tv5qA8Ci9cAkKHGqt3jWjjUAK9juVBqeOcv4OPimQYMrkRX6SvaxBjg== + +"@prisma/fetch-engine@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/fetch-engine/-/fetch-engine-2.17.0.tgz#1814c421e648d0a911d158bbef761eb2256aa31d" + integrity sha512-LgFT40aZyGhJsGU+X9YXYxGhlK0diUlS/ZtxEyoNtFWy6dmToVvfn8il3tmTT6aC2rkTe1ppdDVXjPPip/CIlQ== dependencies: - "@prisma/debug" "2.16.0" - "@prisma/get-platform" "2.16.0" + "@prisma/debug" "2.17.0" + "@prisma/get-platform" "2.17.0" chalk "^4.0.0" execa "^5.0.0" find-cache-dir "^3.3.1" @@ -746,30 +751,30 @@ temp-dir "^2.0.0" tempy "^1.0.0" -"@prisma/generator-helper@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/generator-helper/-/generator-helper-2.16.0.tgz#7953d13a4f2e8e4349fbc97da29e5d8fd792cbd5" - integrity sha512-WqgB2IhyL3bsGgQcK5NWBgUggelKBW2JcbchWvgNCBCwykLAe9dB6TdO/M8fcjYXqR6oJqVz9FucPOa7S0GnSw== +"@prisma/generator-helper@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/generator-helper/-/generator-helper-2.17.0.tgz#545485f3eccc3d20de88798ccbf17bbdca2be062" + integrity sha512-65CzPE/Redp8Un+pNK5y3sRkA2lXnDvNlSklrbs7nl6tFa9ZEVGoVAAt9ZdQy12g95S1Npj6LPO3qWbZxwnCbg== dependencies: - "@prisma/debug" "2.16.0" + "@prisma/debug" "2.17.0" "@types/cross-spawn" "^6.0.1" chalk "^4.0.0" cross-spawn "^7.0.2" -"@prisma/get-platform@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-2.16.0.tgz#74fb1ad72f5268227000bde2ce18acea20ce656e" - integrity sha512-eu4uZlk3zstDhULUdxqQeldhkDj9oO4rRXOcBoVWBr7fiT+/hwGI/CKwtg+o43gKZCufjTSOoIEpVGDpn9qnfQ== +"@prisma/get-platform@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/get-platform/-/get-platform-2.17.0.tgz#80a7706eb52e1dfae6c20c9fdd7a74057f1ddf3d" + integrity sha512-xqH1F3qm+hSgxBznNMhGj5xy3YS/osGtvE+tRxFNugx7Dw9OaVgCvvj1glVjBHSQbb0XXwfHRjYfp7zQjuLzlw== dependencies: - "@prisma/debug" "2.16.0" + "@prisma/debug" "2.17.0" -"@prisma/migrate@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/migrate/-/migrate-2.16.0.tgz#6160bfcc25b9b75b22bad3096c03f3d5636376dd" - integrity sha512-xTG8L8gyePBccy1LAkeTFpxpVeTN+42P6Bz00LAj2G7/35mDRiXMgJJdC1ontoktFlfhGjc0DLT6YeUvEp/GZQ== +"@prisma/migrate@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/migrate/-/migrate-2.17.0.tgz#cf1c63832c1b9433c699ca99c124436090e85fb4" + integrity sha512-7hf443Gx2ONkPsIgs178oHorPG+Pyt43eWVwzHLz6XcyDqEZTHhpzXHvXxSmFwHblEYCRtGLkZrv/IXMo3CviA== dependencies: - "@prisma/debug" "2.16.0" - "@prisma/get-platform" "2.16.0" + "@prisma/debug" "2.17.0" + "@prisma/get-platform" "2.17.0" "@sindresorhus/slugify" "^1.1.0" diff "4.0.2" execa "^5.0.0" @@ -784,17 +789,17 @@ strip-ansi "^6.0.0" strip-indent "^3.0.0" -"@prisma/sdk@2.16.0": - version "2.16.0" - resolved "https://registry.yarnpkg.com/@prisma/sdk/-/sdk-2.16.0.tgz#e21a9748731051222dc650e3827a8000ff7a1b27" - integrity sha512-m5seyxqNMhvqRVou5JN18UaWdv/KrFjgrNVdhgOCfRmSuhwUZVEWjnOjoLbBItIfsMRsvqqd4ztXqm1zXTpA6w== - dependencies: - "@prisma/debug" "2.16.0" - "@prisma/engine-core" "2.16.0" - "@prisma/engines" "2.16.0-44.854c8ba7f0dce66f115af36af24e66989a8c02a1" - "@prisma/fetch-engine" "2.16.0" - "@prisma/generator-helper" "2.16.0" - "@prisma/get-platform" "2.16.0" +"@prisma/sdk@2.17.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@prisma/sdk/-/sdk-2.17.0.tgz#e604b0a5f39669ba27cd1b88a1cb878671788f70" + integrity sha512-8EsU36rZEH16IyaJWbiBR0ORp/CiZf8XHBt95fzRQhFYAvI7uVYyQETdaLyn/jDPxcQDgz36CdbyzVXmscJwIQ== + dependencies: + "@prisma/debug" "2.17.0" + "@prisma/engine-core" "2.17.0" + "@prisma/engines" "2.17.0-35.3c463ebd78b1d21d8fdacdd27899e280cf686223" + "@prisma/fetch-engine" "2.17.0" + "@prisma/generator-helper" "2.17.0" + "@prisma/get-platform" "2.17.0" "@timsuchanek/copy" "^1.4.5" archiver "^4.0.0" arg "^5.0.0" @@ -5835,10 +5840,10 @@ unc-path-regex@^0.1.2: resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= -undici@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-3.2.0.tgz#62ef2336f25d965f321ac799db784ebeb8313ece" - integrity sha512-lBvV7jZirNtDbDmnDJTLbfFDJO6VDav76XRqILfeERlSnAWeYn5pAo6JdPc7OM55RiBZdsh8ucRG9TNfDrDnhg== +undici@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/undici/-/undici-3.3.3.tgz#a90a783a5605fd3d0e093624e261aae234646452" + integrity sha512-JcC6p86DLPDne5vhm9nZ9N6hW/WPCtO8/NV+7YHS+x/mQ+NpWvtGxIt28ObBsySPec8FsabyiLPhmn7Htl9w3A== union-value@^1.0.0: version "1.0.1"