Prisma tools to help you generate CRUD system for GraphQL servers
Full Changelog: https://github.com/paljs/prisma-tools/compare/v6.0.3...v6.0.6
Full Changelog: https://github.com/paljs/prisma-tools/compare/v6.0.2...v6.0.3
Full Changelog: https://github.com/paljs/prisma-tools/compare/v6.0.0...v6.0.2
Replace your graphql queries into the front end and change.
// for null able relation
- where: { user: { type: { equals: USER } } }
+ where: { user: { is: { type: { equals: USER } } } }
// change relation update id
- userId: user.id,
+ user: { connect: { id: user.id } },
// change the orderBy for null able fields
- orderBy: [{ startDate: desc }]
+ orderBy: [{ startDate: { sort: desc } }]
Full Changelog: https://github.com/paljs/prisma-tools/compare/v5.2.0...v6.0.0
Full Changelog: https://github.com/paljs/prisma-tools/compare/v5.0.3...v5.2.0
Fix many issues into the v5.0.0
PNPM
instead of Yarn
, learn
Jest
framework to add some tests to our project.GitHub Actions
for running tests.Prisma 4
.graphql-parse-resolve-info
package in PrismaSelect
plugin[breaking changes] we have a lot of breaking changes
pal.(js|json)
to be pal.config.(js|json)
to fix an issue with windows #230PrismaDelete
plugin totally removed, and we don't need it now Prisma support this option.nexus paljs plugin
// send custom dmmf if you have custom generated client path for generate input types
dmmf?: DMMF.Document[];
// take an array of field names to exclude from any input type
excludeFields?: string[];
// take a function and the input object as arg and return array of fields you want to generate
filterInputs?: (input: DMMF.InputType) => DMMF.SchemaArg[];
// 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;
We added them to pal.config.js
excludeInputFields?: string[];
filterInputs?: (input: DMMF.InputType) => DMMF.SchemaArg[];
// src/graphql/typeDefs.ts
- import { sdlInputs } from '@paljs/plugins';
+ import InputTypes from './InputTypes';
- export default mergeTypeDefs([sdlInputs()]);
+ export default mergeTypeDefs([InputTypes]);
3.x
not working with Prisma 2.x
to work with Prisma 2.x
use Pal.Js 3.x
.distinct
Input arg into findMany
, findCount
, findFirst
now is array of enumsorderBy
input arg into findMany
, findCount
, findFirst
, aggregate
his name was changed.export const UserFindFirstQuery = queryField('findFirstUser', {
type: 'User',
args: {
where: 'UserWhereInput',
- orderBy: list('UserOrderByInput'),
+ orderBy: list('UserOrderByWithRelationInput'),
cursor: 'UserWhereUniqueInput',
take: 'Int',
skip: 'Int',
- distinct: 'UserScalarFieldEnum',
+ distinct: list('UserScalarFieldEnum'),
},
resolve(_parent, args, { prisma, select }) {
return prisma.user.findFirst({
...args,
...select,
})
},
})
In nexus we do not write on the queries or mutations files you must delete these files if you did not have any custom work on it and re-run pal g
again. Or if you have some custom work on these files you will need to go inside these files and change the args as we show in the diff code
In SDL generator we rewrite on the typeDef
file to apply the changes coming from prisma schema so all you need to do is pal g
and our script will update the types for you
Support Charka UI as a UI framework on Nextjs template
onDelete
plugin while Prisma 2.26.0 have this featurepal.js
file.