Hey ppl, is there a update to update prisma versio...
# orm-help
n
Hey ppl, is there a update to update prisma versions? I am currently using
1.20.5
and want to use
set
feature between relations that was added later. Is there an update guide with breaking changes? I found
Update to ...
links on Release and Maintenance section on prisma docs but they are outdated.
@Harshit Can you help me, please?
h
Just change the version and redeploy
there are not many breaking changes
n
thx, I made the prisma deploy with the new version but I can't find the
set
function on a toMany relation. Do you know what I can be doing wrong?
j
check your package.json
n
Do I need to update prisma-binding too?
j
prisma-binding latest is 2.3.10 and it's been there for a while
n
I updated to prisma 1.28.0, the
set
on toMany relations was released on 1.25.0
j
depending on your setup, you might need to increment the prisma version in a few places, ie the docker-compose, the prisma console, etc
if you are updating, jump to the latest at 1.30.1
n
Maybe we need to remove some fixed dependencies, that we needed to set because of out of sync graphql version compatibility with graphql-yoga in the earlier version that we were using
j
add this to your package.json:
Copy code
"resolutions": {
    "graphql": "14.2.1"
  }
n
Typescript started to complain about
graphql-binding
Will try to check compatibility
do you know what could be causing this error?
Copy code
node_modules/graphql-binding/dist/codegen/TypescriptGenerator.d.ts:22:40 - error TS2315: Type 'GraphQLObjectType' is not generic.
probably a mismatch version xD
j
i've never seen that
h
What is your graphqljs version
?
n
not using graphqljs. My current package json is like this.
Copy code
"dependencies": {
    "bcryptjs": "2.4.3",
    "graphql-yoga": "1.16.0",
    "jsonwebtoken": "8.3.0",
    "sendgrid": "^5.2.3",
    "request": "2.88.0",
    "moment": "^2.22.1"
  },
  "devDependencies": {
    "@types/node": "~8.9.4",
    "@types/validator": "9.4.2",
    "@types/zen-observable": "^0.8.0",
    "aws-sdk": "2.346.0",
    "dotenv": "6.1.0",
    "dotenv-cli": "1.4.0",
    "graphql-middleware": "2.0.2",
    "lodash": "4.17.11",
    "merge-graphql-schemas": "1.5.7",
    "nodemon": "1.18.5",
    "npm-run-all": "4.1.3",
    "prisma": "1.30.1",
    "prisma-binding": "2.0.2",
    "rimraf": "2.6.2",
    "ts-node": "7.0.1",
    "tslint": "5.11.0",
    "typescript": "2.9.2"
  },
  "resolutions": {
    "graphql": "14.2.1"
  },
changed the graphql to resolution node as @Jared suggested and the graphql mismatch error between depencies stopped to happen
j
FYI you can do
yarn upgrade-interactive
to quickly upgrade all the deps. You get a cool cli interface to choose which one to update
i see you prisma-binding is old, and typescript is old too
h
yes, and you are using graphql js(graphql package is essentially graphql js(the reference implementation))
n
oh, got it! Thx for the explanation =]
gonna update and see what happens
@Jared I run
yarn upgrade-interactive
and got
Copy code
yarn upgrade-interactive v1.15.2
success All of your dependencies are up to date.
I got the same errors
Copy code
node_modules/graphql-binding/dist/codegen/TypescriptGenerator.d.ts:22:40 - error TS2315: Type 'GraphQLObjectType' is not generic.
h
try nuking node_modules
and installing everything again
that fix these type for errors many times
n
This error is happening during transpiling but I see that the generated prisma.graphql does not have the
set
option on a toMany relations update
I found a "solution" changing the tsconfig to not validate libs
@Harshit and @Jared I am generating prisma.graphql with
graphql get-schema --project database
The database config in
graphqlconfig.yml
is like this:
Copy code
database:
    prisma: database/prisma.yml
    schemaPath: "src/generated/prisma.graphql"
    extensions:
      prisma: database/prisma.yml
      codegen:
        - generator: prisma-binding
          language: typescript
          output:
            binding: src/generated/prisma.ts
I used
prisma generate
and the schema was updated now
I just found out that the syntax has changed a little on the prisma context usage