Skip to content

Releases: paljs/prisma-tools

v2.12.0

03 Feb 19:51
Compare
Choose a tag to compare

Fixing many issues

#168
#171
#172
#173
#174

v2.11.0

05 Jan 17:26
Compare
Choose a tag to compare

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

17 Dec 22:39
Compare
Choose a tag to compare

#164 fix issue in nexus-plugin-prisma generator.

Breaking changes

Updating our generators and examples to work with the new version of nexus v1.0

v2.9.2

11 Dec 09:22
Compare
Choose a tag to compare

generator

update enum name to fix #163 issue.

v2.9.0

10 Dec 21:42
Compare
Choose a tag to compare

Breaking changes

This version working from Prisma v2.13.0 and nexus v0.19.2.

v2.8.3

25 Nov 17:31
Compare
Choose a tag to compare

Fix an issue in SDL generator #159

v2.8.0

24 Nov 21:15
Compare
Choose a tag to compare

breaking changes

This version starts working from Prisma version 2.12.0.

v2.7.0

24 Nov 21:13
Compare
Choose a tag to compare

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

23 Nov 00:48
Compare
Choose a tag to compare

v2.6.2

16 Nov 23:57
Compare
Choose a tag to compare

create

Fix bug in got package when creating a new project