Skip to content

Commit

Permalink
feat: update nexus and prisma versions (#54)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: no longer compatible with prisma < 2.16.0
  • Loading branch information
jaymaycry committed Feb 19, 2021
1 parent 564fc6f commit 3773626
Show file tree
Hide file tree
Showing 10 changed files with 762 additions and 360 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/preset-typescript": "^7.9.0",
"@nexus/schema": "^0.19.2",
"@prisma/cli": "2.12.1",
"@prisma/client": "2.12.1",
"@prisma/client": "~2.16.0",
"@types/jest": "^25.2.1",
"@types/node": "^13.13.4",
"@typescript-eslint/eslint-plugin": "^2.28.0",
Expand All @@ -17,16 +15,18 @@
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.3",
"graphql": "~15.0.0",
"graphql": "~15.5.0",
"graphql-tag": "^2.10.3",
"jest": "^25.4.0",
"jest-matcher-utils": "^25.4.0",
"lerna": "^3.20.2",
"lodash": "^4.17.15",
"nexus-plugin-prisma": "^0.25.0",
"nexus": "^1.0.0",
"nexus-plugin-prisma": "^0.30.0",
"path": "^0.12.7",
"pluralize": "~7.0.0",
"prettier": "^2.0.5",
"prisma": "~2.16.0",
"react": "~16.12.0",
"react-admin": "^3.4.3",
"react-dom": "~16.13.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"pluralize": "^7.0.0"
},
"peerDependencies": {
"@nexus/schema": ">=0.19.0"
"nexus": ">=1.0.0"
},
"devDependencies": {
"rimraf": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/addCrudResolvers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ResourceOptions, CommonOptions } from "./types";
import setupCrudResolvers from "./setupCrudResolvers";
import { extendType, arg, intArg } from "@nexus/schema";
import { extendType, arg, intArg } from "nexus";

const addCrudResolvers = (
resourceName: string,
Expand Down
75 changes: 52 additions & 23 deletions packages/dataprovider/generated/nexus-prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import * as Prisma from '@prisma/client';

// Pagination type
type Pagination = {
take?: boolean
skip?: boolean
cursor?: boolean
take?: boolean
skip?: boolean
cursor?: boolean
}

// Prisma custom scalar names
type CustomScalars = 'Json'
type CustomScalars = 'Json' | 'DateTime'

// Prisma model type definitions
interface PrismaModels {
Expand All @@ -18,6 +18,7 @@ interface PrismaModels {
BlogPost: Prisma.BlogPost
BlogPostComment: Prisma.BlogPostComment
User: Prisma.User
FilteringTest: Prisma.FilteringTest
SomePublicRecordWithIntId: Prisma.SomePublicRecordWithIntId
}

Expand All @@ -34,15 +35,19 @@ interface NexusPrismaInputs {
}
blogPosts: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'title' | 'text' | 'author' | 'authorId' | 'comments'
ordering: 'id' | 'title' | 'text' | 'authorId'
ordering: 'id' | 'title' | 'text' | 'author' | 'authorId'
}
blogPostComments: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'text' | 'post' | 'postId' | 'author' | 'authorId'
ordering: 'id' | 'text' | 'postId' | 'authorId'
ordering: 'id' | 'text' | 'post' | 'postId' | 'author' | 'authorId'
}
users: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'email' | 'roles' | 'firstName' | 'lastName' | 'gender' | 'yearOfBirth' | 'wantsNewsletter' | 'interests' | 'userSocialMedia' | 'address' | 'blogPosts' | 'comments'
ordering: 'id' | 'email' | 'firstName' | 'lastName' | 'gender' | 'yearOfBirth' | 'wantsNewsletter' | 'interests' | 'address'
ordering: 'id' | 'email' | 'firstName' | 'lastName' | 'gender' | 'yearOfBirth' | 'wantsNewsletter' | 'interests' | 'userSocialMedia' | 'address'
}
filteringTests: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'intField' | 'floatField' | 'stringField' | 'dateTimeField' | 'boolField' | 'intField_lt' | 'intField_bt' | 'snake_field' | 'snake_field_bt'
ordering: 'id' | 'intField' | 'floatField' | 'stringField' | 'dateTimeField' | 'boolField' | 'intField_lt' | 'intField_bt' | 'snake_field' | 'snake_field_bt'
}
somePublicRecordWithIntIds: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'title'
Expand All @@ -52,7 +57,7 @@ interface NexusPrismaInputs {
UserRole: {
users: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'email' | 'roles' | 'firstName' | 'lastName' | 'gender' | 'yearOfBirth' | 'wantsNewsletter' | 'interests' | 'userSocialMedia' | 'address' | 'blogPosts' | 'comments'
ordering: 'id' | 'email' | 'firstName' | 'lastName' | 'gender' | 'yearOfBirth' | 'wantsNewsletter' | 'interests' | 'address'
ordering: 'id' | 'email' | 'firstName' | 'lastName' | 'gender' | 'yearOfBirth' | 'wantsNewsletter' | 'interests' | 'userSocialMedia' | 'address'
}
}
UserSocialMedia: {
Expand All @@ -61,7 +66,7 @@ interface NexusPrismaInputs {
BlogPost: {
comments: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'text' | 'post' | 'postId' | 'author' | 'authorId'
ordering: 'id' | 'text' | 'postId' | 'authorId'
ordering: 'id' | 'text' | 'post' | 'postId' | 'author' | 'authorId'
}
}
BlogPostComment: {
Expand All @@ -74,12 +79,15 @@ interface NexusPrismaInputs {
}
blogPosts: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'title' | 'text' | 'author' | 'authorId' | 'comments'
ordering: 'id' | 'title' | 'text' | 'authorId'
ordering: 'id' | 'title' | 'text' | 'author' | 'authorId'
}
comments: {
filtering: 'AND' | 'OR' | 'NOT' | 'id' | 'text' | 'post' | 'postId' | 'author' | 'authorId'
ordering: 'id' | 'text' | 'postId' | 'authorId'
ordering: 'id' | 'text' | 'post' | 'postId' | 'author' | 'authorId'
}
}
FilteringTest: {

}
SomePublicRecordWithIntId: {

Expand All @@ -99,45 +107,53 @@ interface NexusPrismaOutputs {
blogPostComments: 'BlogPostComment'
user: 'User'
users: 'User'
filteringTest: 'FilteringTest'
filteringTests: 'FilteringTest'
somePublicRecordWithIntId: 'SomePublicRecordWithIntId'
somePublicRecordWithIntIds: 'SomePublicRecordWithIntId'
},
Mutation: {
createOneUserRole: 'UserRole'
updateOneUserRole: 'UserRole'
updateManyUserRole: 'BatchPayload'
updateManyUserRole: 'AffectedRowsOutput'
deleteOneUserRole: 'UserRole'
deleteManyUserRole: 'BatchPayload'
deleteManyUserRole: 'AffectedRowsOutput'
upsertOneUserRole: 'UserRole'
createOneUserSocialMedia: 'UserSocialMedia'
updateOneUserSocialMedia: 'UserSocialMedia'
updateManyUserSocialMedia: 'BatchPayload'
updateManyUserSocialMedia: 'AffectedRowsOutput'
deleteOneUserSocialMedia: 'UserSocialMedia'
deleteManyUserSocialMedia: 'BatchPayload'
deleteManyUserSocialMedia: 'AffectedRowsOutput'
upsertOneUserSocialMedia: 'UserSocialMedia'
createOneBlogPost: 'BlogPost'
updateOneBlogPost: 'BlogPost'
updateManyBlogPost: 'BatchPayload'
updateManyBlogPost: 'AffectedRowsOutput'
deleteOneBlogPost: 'BlogPost'
deleteManyBlogPost: 'BatchPayload'
deleteManyBlogPost: 'AffectedRowsOutput'
upsertOneBlogPost: 'BlogPost'
createOneBlogPostComment: 'BlogPostComment'
updateOneBlogPostComment: 'BlogPostComment'
updateManyBlogPostComment: 'BatchPayload'
updateManyBlogPostComment: 'AffectedRowsOutput'
deleteOneBlogPostComment: 'BlogPostComment'
deleteManyBlogPostComment: 'BatchPayload'
deleteManyBlogPostComment: 'AffectedRowsOutput'
upsertOneBlogPostComment: 'BlogPostComment'
createOneUser: 'User'
updateOneUser: 'User'
updateManyUser: 'BatchPayload'
updateManyUser: 'AffectedRowsOutput'
deleteOneUser: 'User'
deleteManyUser: 'BatchPayload'
deleteManyUser: 'AffectedRowsOutput'
upsertOneUser: 'User'
createOneFilteringTest: 'FilteringTest'
updateOneFilteringTest: 'FilteringTest'
updateManyFilteringTest: 'AffectedRowsOutput'
deleteOneFilteringTest: 'FilteringTest'
deleteManyFilteringTest: 'AffectedRowsOutput'
upsertOneFilteringTest: 'FilteringTest'
createOneSomePublicRecordWithIntId: 'SomePublicRecordWithIntId'
updateOneSomePublicRecordWithIntId: 'SomePublicRecordWithIntId'
updateManySomePublicRecordWithIntId: 'BatchPayload'
updateManySomePublicRecordWithIntId: 'AffectedRowsOutput'
deleteOneSomePublicRecordWithIntId: 'SomePublicRecordWithIntId'
deleteManySomePublicRecordWithIntId: 'BatchPayload'
deleteManySomePublicRecordWithIntId: 'AffectedRowsOutput'
upsertOneSomePublicRecordWithIntId: 'SomePublicRecordWithIntId'
},
UserRole: {
Expand Down Expand Up @@ -183,6 +199,18 @@ interface NexusPrismaOutputs {
blogPosts: 'BlogPost'
comments: 'BlogPostComment'
}
FilteringTest: {
id: 'Int'
intField: 'Int'
floatField: 'Float'
stringField: 'String'
dateTimeField: 'DateTime'
boolField: 'Boolean'
intField_lt: 'String'
intField_bt: 'Int'
snake_field: 'Int'
snake_field_bt: 'Int'
}
SomePublicRecordWithIntId: {
id: 'Int'
title: 'String'
Expand All @@ -196,6 +224,7 @@ interface NexusPrismaMethods {
BlogPost: Typegen.NexusPrismaFields<'BlogPost'>
BlogPostComment: Typegen.NexusPrismaFields<'BlogPostComment'>
User: Typegen.NexusPrismaFields<'User'>
FilteringTest: Typegen.NexusPrismaFields<'FilteringTest'>
SomePublicRecordWithIntId: Typegen.NexusPrismaFields<'SomePublicRecordWithIntId'>
Query: Typegen.NexusPrismaFields<'Query'>
Mutation: Typegen.NexusPrismaFields<'Mutation'>
Expand Down
Loading

0 comments on commit 3773626

Please sign in to comment.