Prisma Tools Versions Save

Prisma tools to help you generate CRUD system for GraphQL servers

v6.0.6

8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/paljs/prisma-tools/compare/v6.0.3...v6.0.6

v6.0.3

8 months ago

What's Changed

Full Changelog: https://github.com/paljs/prisma-tools/compare/v6.0.2...v6.0.3

v6.0.2

8 months ago

What's Changed

Full Changelog: https://github.com/paljs/prisma-tools/compare/v6.0.0...v6.0.2

v6.0.0

8 months ago

Breaking changes

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 } }]

What's Changed

New Contributors

Full Changelog: https://github.com/paljs/prisma-tools/compare/v5.2.0...v6.0.0

v5.2.0

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/paljs/prisma-tools/compare/v5.0.3...v5.2.0

v5.0.3

1 year ago

Fix many issues into the v5.0.0

v5.0.0

1 year ago
  • using PNPM instead of Yarn, learn
  • using the Jest framework to add some tests to our project.
  • using GitHub Actions for running tests.
  • upgrade to support Prisma 4.
  • using graphql-parse-resolve-info package in PrismaSelect plugin

[breaking changes] we have a lot of breaking changes

  • The config file name changed from pal.(js|json) to be pal.config.(js|json) to fix an issue with windows #230
  • PrismaDelete plugin totally removed, and we don't need it now Prisma support this option.
  • remove some options from the 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[];
  • SDL first update we changed our way to generate inputs from run time to file system, so we don't need to generate inputs every time we run the server.
// src/graphql/typeDefs.ts
- import { sdlInputs } from '@paljs/plugins';
+ import InputTypes from './InputTypes';

- export default mergeTypeDefs([sdlInputs()]);
+ export default mergeTypeDefs([InputTypes]);

v4.0.0

2 years ago

Breaking changes

  • Must have Prisma version 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 enums
  • orderBy 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,
    })
  },
})

Upgrade guide

nexus generator

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

SDL generator

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

v3.8.2

2 years ago

New feature [CLI Create]

Support Charka UI as a UI framework on Nextjs template

v3.6.0

2 years ago

Drop using onDelete plugin while Prisma 2.26.0 have this feature

  • drop from pal.js file.
  • drop from context file
  • drop from generator

[admin]

  • fix some styling issues