Releases: paljs/prisma-tools
Releases · paljs/prisma-tools
v2.12.0
v2.11.0
Upgrade to Prisma 2.14
Generator
- make nexus code more simple.
- add a description field to types from the schema.prisma file
/// User Model will add to Graphql User type
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
email String @unique
name String?
password String
/// user Posts relation
/// will add to Graphql field
posts Post[]
}
v2.10.0
v2.9.2
v2.9.0
Breaking changes
This version working from Prisma v2.13.0
and nexus v0.19.2
.
v2.8.3
v2.8.0
breaking changes
This version starts working from Prisma version 2.12.0
.
v2.7.0
Fixing #136
plugins
sdlInputs
function has a new option to skip FieldUpdateOperationsInput
type.
interface OptionsType {
// if you use a custom generated files path you need to import dmmf from this path and send to our function through this option.
dmmf?: DMMF.Document;
// by default when we create update inputs you will set data like {username: {set: "Ahmed"}} by making this option true you will be able to use it like {username: "Ahmed"} without set.
// but you will also lose these options for number fields
// increment: x: Adds x to the current value
// decrement: x: Subtracts x from the current value
// multiply: x: Multiplies the current value by x
// divide: x: Divides the current value by x
// set: x: Sets the value to x (equivalent to data: { age: 18 })
doNotUseFieldUpdateOperationsInput?: boolean;
}
// example
import { dmmf } from './prismaCustomPath';
import { mergeTypeDefs } from '@graphql-tools/merge';
import { sdlInputs } from '@paljs/plugins';
export default mergeTypeDefs([sdlInputs({ dmmf }), ...customTypes]);
nexus
adding a new option to nexus paljs plugin
paljs({
// include Prisma Admin schema query and mutations
includeAdmin: true,
// by default adminSchemaPath is `adminSettings.json` you can change it
adminSchemaPath: 'adminSettings.json',
// this options will pass to PrismaSelect class as second arg.
prismaSelectOptions?: {
// take default fields object accepted by PrismaSelect class { [key: string]: { [key: string]: boolean } }
defaultFields?: { [key: string]: { [key: string]: boolean } };
// send custom dmmf if you have custom generated client path
dmmf?: DMMF.Document;
};
// send custom dmmf if you have custom generated client path for generate input types
dmmf?: DMMF.Document;
// by default when we create update inputs you will set data like {username: {set: "Ahmed"}} by making this option true you will be able to use it like {username: "Ahmed"} without set.
// but you will also lose these options for number fields
// increment: x: Adds x to the current value
// decrement: x: Subtracts x from the current value
// multiply: x: Multiplies the current value by x
// divide: x: Divides the current value by x
// set: x: Sets the value to x (equivalent to data: { age: 18 })
doNotUseFieldUpdateOperationsInput?: boolean;
});
v2.6.3
v2.6.2
create
Fix bug in got
package when creating a new project