GraphQL Code-First Approach with NestJS 7 #170
Replies: 9 comments
-
Hi, excelent post! This is my console output when npm run start:dev
My resolver
I simplify the User model trying to isolate the issue
GraphQL entity
Thank you, |
Beta Was this translation helpful? Give feedback.
-
@NiicooR Hi Nico, I actually had the same error last week. Do you have by any chance |
Beta Was this translation helpful? Give feedback.
-
@marcjulian, That's the same case for me!. I've just downgraded my typescript version and everything starts working. How did you notice that the typescript's version was the problem? Anyways, Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
Perfect. I am not sure, but I know in another application it was working without error and just with a lower typescript version. Might be good to create an issue with prisma so they can fix issues with typescript 4.2.x |
Beta Was this translation helpful? Give feedback.
-
Hi Marc! Great post. In the docs it says that the plugin will |
Beta Was this translation helpful? Give feedback.
-
@eliotis Hi, can you provide a reproduction repo? I am not sure what the problem is. Have you added the plugin to your {
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"plugins": ["@nestjs/graphql"]
}
} Also you need to make sure that your file names have one of the following suffix to be picked up by the cli https://docs.nestjs.com/graphql/cli-plugin#overview
|
Beta Was this translation helpful? Give feedback.
-
Hi Marc, I have been struggling with something and I hope you can help me. I am relatively new to the Nest and to Programming in general. You mentioned that we are using Prisma and when I checked the other blog you have on the Prisma / Nest integration i can tell that we are following a SDL approach no t. However in this blog you are following code-first .. I am a bit confused with integrating prisma and nest. should I also maintain schema.prisma file under the prisma folder or rely on the autogenerated file like what you have here? |
Beta Was this translation helpful? Give feedback.
-
Hi @enjora, I wrote about this topic in this disscussion. TL;DR you need to maintain Code-first only autogenerates the GraphQL api based on your entity files. |
Beta Was this translation helpful? Give feedback.
-
Cracking article thanks. From a UX POV the shooting star in dark mode, whilst is a neat idea, i found it terribly off putting. Something on the screen suddenly starts moving to the side of the area i am focussing on. It would be great if there was a way to turn this off (using dev tools doesn't count!) |
Beta Was this translation helpful? Give feedback.
-
GraphQL Code-First Approach with NestJS 7
Create a GraphQL API using Code-First Approach with NestJS 7.
https://notiz.dev/blog/graphql-code-first-with-nestjs-7
Beta Was this translation helpful? Give feedback.
All reactions