Skip to content

Commit

Permalink
feat(deps): support for prisma 2.14
Browse files Browse the repository at this point in the history
closes #1003

BREAKING CHANGE:

Peer dep requirements for @prisma/client moved from 2.13.x to 2.14.x.

In practice 2.13 should still work, but we do not test this package
against it officially.
  • Loading branch information
jasonkuhrt committed Jan 6, 2021
1 parent 9242206 commit b5588e0
Show file tree
Hide file tree
Showing 7 changed files with 742 additions and 1,095 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.13.x",
"@prisma/client": "2.14.x",
"graphql": "^15.3.0",
"nexus": "^1.0.0"
},
Expand All @@ -46,12 +46,12 @@
},
"devDependencies": {
"@prisma-labs/prettier-config": "0.1.0",
"@prisma/cli": "2.13.0",
"@prisma/client": "2.13.0",
"@prisma/fetch-engine": "2.13.0",
"@prisma/get-platform": "2.13.0",
"@prisma/migrate": "2.13.0",
"@prisma/sdk": "2.13.0",
"@prisma/cli": "2.14.0",
"@prisma/client": "2.14.0",
"@prisma/fetch-engine": "2.14.0",
"@prisma/get-platform": "2.14.0",
"@prisma/migrate": "2.14.0",
"@prisma/sdk": "2.14.0",
"@types/jest": "26.0.19",
"@types/lodash": "4.14.167",
"@types/node": "14.14.20",
Expand All @@ -60,6 +60,7 @@
"@types/prettier": "2.1.6",
"@types/semver": "7.3.4",
"dripip": "0.10.0",
"execa": "^5.0.0",
"get-port": "5.1.1",
"graphql": "15.4.0",
"graphql-request": "3.4.0",
Expand Down
3 changes: 3 additions & 0 deletions tests/__app/generated/nexus-typegen.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export interface NexusGenInputs {
in?: string[] | null; // [String!]
lt?: string | null; // String
lte?: string | null; // String
mode?: NexusGenEnums['QueryMode'] | null; // QueryMode
not?: NexusGenInputs['NestedStringFilter'] | null; // NestedStringFilter
notIn?: string[] | null; // [String!]
startsWith?: string | null; // String
Expand All @@ -258,6 +259,7 @@ export interface NexusGenInputs {
in?: string[] | null; // [String!]
lt?: string | null; // String
lte?: string | null; // String
mode?: NexusGenEnums['QueryMode'] | null; // QueryMode
not?: NexusGenInputs['NestedStringNullableFilter'] | null; // NestedStringNullableFilter
notIn?: string[] | null; // [String!]
startsWith?: string | null; // String
Expand Down Expand Up @@ -303,6 +305,7 @@ export interface NexusGenInputs {

export interface NexusGenEnums {
PostStatus: "DRAFT" | "PUBLISHED"
QueryMode: "default" | "insensitive"
SortOrder: "asc" | "desc"
}

Expand Down
7 changes: 7 additions & 0 deletions tests/__app/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ type Query {
users(after: UserWhereUniqueInput, before: UserWhereUniqueInput, first: Int, last: Int): [User!]!
}

enum QueryMode {
default
insensitive
}

enum SortOrder {
asc
desc
Expand All @@ -305,6 +310,7 @@ input StringFilter {
in: [String!]
lt: String
lte: String
mode: QueryMode
not: NestedStringFilter
notIn: [String!]
startsWith: String
Expand All @@ -319,6 +325,7 @@ input StringNullableFilter {
in: [String!]
lt: String
lte: String
mode: QueryMode
not: NestedStringNullableFilter
notIn: [String!]
startsWith: String
Expand Down
10 changes: 8 additions & 2 deletions tests/__app/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
generator prisma_client {
provider = "prisma-client-js"
output = "../../node_modules/@prisma/client"
provider = "prisma-client-js"
output = "../../node_modules/@prisma/client"
}

datasource db {
provider = "postgres"
// Unused by test suite. Here to satisfy Prisma project requirements.
url = env("DB_URL")
}

model Bubble {
Expand Down
54 changes: 54 additions & 0 deletions tests/__snapshots__/app.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ type Query {
users(after: UserWhereUniqueInput, before: UserWhereUniqueInput, first: Int, last: Int): [User!]!
}
enum QueryMode {
default
insensitive
}
enum SortOrder {
asc
desc
Expand All @@ -306,6 +311,7 @@ input StringFilter {
in: [String!]
lt: String
lte: String
mode: QueryMode
not: NestedStringFilter
notIn: [String!]
startsWith: String
Expand All @@ -320,6 +326,7 @@ input StringNullableFilter {
in: [String!]
lt: String
lte: String
mode: QueryMode
not: NestedStringNullableFilter
notIn: [String!]
startsWith: String
Expand Down Expand Up @@ -1059,6 +1066,13 @@ Object {
"desc",
],
},
Object {
"name": "QueryMode",
"values": Array [
"default",
"insensitive",
],
},
Object {
"name": "BubbleScalarFieldEnum",
"values": Array [
Expand Down Expand Up @@ -1101,6 +1115,13 @@ Object {
"desc",
],
},
Object {
"name": "QueryMode",
"values": Array [
"default",
"insensitive",
],
},
],
"prisma": Array [
Object {
Expand Down Expand Up @@ -1145,6 +1166,13 @@ Object {
"desc",
],
},
Object {
"name": "QueryMode",
"values": Array [
"default",
"insensitive",
],
},
],
},
"inputObjectTypes": Object {
Expand Down Expand Up @@ -3020,6 +3048,19 @@ Object {
"isRequired": false,
"name": "endsWith",
},
Object {
"inputTypes": Array [
Object {
"isList": false,
"location": "enumTypes",
"namespace": "prisma",
"type": "QueryMode",
},
],
"isNullable": false,
"isRequired": false,
"name": "mode",
},
Object {
"inputTypes": Array [
Object {
Expand Down Expand Up @@ -3508,6 +3549,19 @@ Object {
"isRequired": false,
"name": "endsWith",
},
Object {
"inputTypes": Array [
Object {
"isList": false,
"location": "enumTypes",
"namespace": "prisma",
"type": "QueryMode",
},
],
"isNullable": false,
"isRequired": false,
"name": "mode",
},
Object {
"inputTypes": Array [
Object {
Expand Down
4 changes: 2 additions & 2 deletions tests/app.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as cp from 'child_process'
import execa from 'execa'
import * as FS from 'fs-jetpack'
import * as nexusBuilder from 'nexus/dist/builder'
import * as Path from 'path'
Expand All @@ -25,7 +25,7 @@ it('integrates together', async () => {
// Run Prisma generation:
// - Prisma Client JS
//
cp.execSync('../../node_modules/.bin/prisma generate', {
execa.sync('prisma', ['generate'], {
cwd: fs.cwd(),
})

Expand Down
Loading

0 comments on commit b5588e0

Please sign in to comment.