Skip to content

Commit

Permalink
upgrade to prisma version 2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedElywa committed Sep 29, 2020
1 parent f345c7b commit 2d5f34a
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/create/examples/apollo-nexus-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@nexus/schema": "0.x",
"@prisma/client": "2.x",
"@paljs/nexus": "1.5.5",
"@paljs/nexus": "1.5.6",
"apollo-server": "2.x",
"graphql": "15.x"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create/examples/apollo-sdl-first/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@graphql-tools/merge": "6.x",
"@paljs/plugins": "1.5.5",
"@paljs/plugins": "1.5.6",
"@prisma/client": "2.x",
"apollo-server": "2.x",
"graphql": "15.x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@nexus/schema": "0.x",
"@paljs/nexus": "1.5.5",
"@paljs/nexus": "1.5.6",
"@prisma/client": "2.x",
"apollo-server": "2.x",
"bcryptjs": "2.x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"dependencies": {
"@apollo/client": "3.x",
"@paljs/admin": "1.5.1",
"@paljs/admin": "1.5.6",
"@paljs/ui": "1.x",
"@paljs/icons": "1.x",
"babel-plugin-styled-components": "1.x",
Expand Down
4 changes: 2 additions & 2 deletions packages/create/examples/full-stack-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@apollo/client": "3.x",
"@apollo/react-ssr": "4.x",
"@nexus/schema": "0.x",
"@paljs/nexus": "1.5.5",
"@paljs/admin": "1.5.1",
"@paljs/nexus": "1.5.6",
"@paljs/admin": "1.5.6",
"@paljs/ui": "1.x",
"@paljs/icons": "1.x",
"@prisma/client": "2.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/create/examples/graphql-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@graphql-modules/core": "0.x",
"@graphql-modules/di": "0.x",
"@paljs/plugins": "1.5.5",
"@paljs/plugins": "1.5.6",
"@prisma-tools/graphql-modules": "0.x",
"@prisma/client": "2.x",
"apollo-server": "2.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/create/examples/nexus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@prisma/client": "2.x",
"nexus": "0.x",
"nexus-plugin-paljs": "1.5.5"
"nexus-plugin-paljs": "1.5.6"
},
"devDependencies": {
"@prisma/cli": "2.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"prettier": "^2.0.5"
},
"devDependencies": {
"@prisma/client": "2.0.1",
"@prisma/client": "2.8.0",
"@types/node": "13.13.5",
"@types/prettier": "2.0.1",
"typescript": "4.0.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/generator/src/graphql-modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ const getField = (field: DMMF.SchemaField, content: string) => {
if (field.args.length > 0) {
content += '(';
field.args.forEach((arg) => {
content += `${arg.name}: ${arg.inputType[0].type}
content += `${arg.name}: ${arg.inputTypes[0].type}
`;
});
content += ')';
}
content += `: ${
field.outputType.isList
? `[${field.outputType.type}!]!`
: field.outputType.type + (field.outputType.isRequired ? '!' : '')
: field.outputType.type + (field.isRequired ? '!' : '')
}`;
return content;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/generator/src/nexus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class GenerateNexus extends Generators {
private getOptions(field: DMMF.SchemaField) {
const options: any = field.outputType.isList
? { nullable: false, list: [true] }
: { nullable: !field.outputType.isRequired };
: { nullable: !field.isRequired };
if (
field.outputType.kind !== 'scalar' ||
field.outputType.type === 'DateTime'
Expand All @@ -180,7 +180,7 @@ export class GenerateNexus extends Generators {
if (field.args.length > 0) {
field.args.forEach((arg) => {
if (!options['args']) options['args'] = {};
options['args'][arg.name] = arg.inputType[0].type;
options['args'][arg.name] = arg.inputTypes[0].type;
});
}
let toString = JSON.stringify(options);
Expand Down
4 changes: 2 additions & 2 deletions packages/generator/src/sdl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export class GenerateSdl extends Generators {
if (field.args.length > 0) {
fileContent += '(';
field.args.forEach((arg) => {
fileContent += `${arg.name}: ${arg.inputType[0].type}
fileContent += `${arg.name}: ${arg.inputTypes[0].type}
`;
});
fileContent += ')';
}
fileContent += `: ${
field.outputType.isList
? `[${field.outputType.type}!]!`
: field.outputType.type + (field.outputType.isRequired ? '!' : '')
: field.outputType.type + (field.isRequired ? '!' : '')
}`;
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/nexus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"@nexus/schema": "0.14.0",
"@prisma/client": "2.0.1",
"@prisma/client": "2.8.0",
"@types/lowdb": "1.0.9",
"typescript": "4.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"access": "public"
},
"devDependencies": {
"@prisma/client": "2.0.1",
"@prisma/client": "2.8.0",
"typescript": "4.0.2"
},
"files": [
Expand Down
12 changes: 6 additions & 6 deletions packages/plugins/src/sdlInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ function createInput() {
model.fields.forEach((field) => {
let inputType: DMMF.SchemaArgInputType;
if (
field.inputType.length > 1 &&
field.inputType[1].type !== 'null' &&
field.inputTypes.length > 1 &&
field.inputTypes[1].type !== 'null' &&
field.name !== 'not'
) {
inputType = field.inputType[1];
inputType = field.inputTypes[1];
} else {
inputType = field.inputType[0];
inputType = field.inputTypes[0];
}
fileContent += `${field.name}: ${
inputType.isList ? `[${inputType.type}!]` : inputType.type
}${inputType.isRequired ? '!' : ''}
}${field.isRequired ? '!' : ''}
`;
});
fileContent += `}
Expand All @@ -56,7 +56,7 @@ function createInput() {
field.outputType.isList
? `[${field.outputType.type}!]`
: field.outputType.type
}${field.outputType.isRequired ? '!' : ''}
}${field.isRequired ? '!' : ''}
`;
});
fileContent += `}
Expand Down

0 comments on commit 2d5f34a

Please sign in to comment.