I am trying to upgrade to Prisma 2 with photon and @prisma/nexus based on this documentation, but am running into this error:

How do I use them together now?
Hey @mxstbr! I am currently focused on https://github.com/prisma/nexus/pull/205. After that I will jump on this. I believe resolving the former issue will assist on addressing issues like this one.
I am also running into this issue but with t.crud
Same issue here.
Same issue only "@prisma/nexus": "^0.0.1", works for me
Ok, focusing on this now. Started updating the example to something working/useful tonight in #368. Able to repro this issue there now. Will continue the investigation throughout the week. I start full-time with Prisma next week so that will help a lot with regard to time allocation :)
The JS-side is OK, e.g. making queries with the GraphQL api is working. The issue seems limited to a matter of improper typegen.
I'm getting the same issue with t.crud right now. It's so strange because I've rebuilt my docker environment many times throughout the day today and then all of a sudden I started having this issue. I can't seem to fix it by going through the suggestion made by @chenfanggm in that other thread by setting:
"nexus": "0.11.7"
and
"ts-node-dev": "^1.0.0-pre.40",
My current setup is:
"nexus": "^0.12.0-beta.6"
"@prisma/nexus": "^0.0.1",
"ts-node": "^8.3.0",
Has anyone figured out a winning combination? :)
Facing this issue after upgrading prisma2 to preview 9 this morning, hope it will be solved soon.
I am also facing this issue after upgrading to Preview 9.1 this morning.
The dynamicOutputProperty we [thought we] [fixed in nexus](https://github.com/prisma/nexus/pull/205) did not include updates to the typegen module. Using dynamicInputMethod or dynamicOutputMethod results in typegen like:
declare global {
interface NexusGenCustomInputMethods<TypeName extends string> {
bar(...args: any): void
}
}
declare global {
interface NexusGenCustomOutputMethods<TypeName extends string> {
foo(...args: any): void
}
}
However not for for dynamicOutputProperty.
I will release a fix Sunday night EST (ci-cd automated releases & pre-releases are coming soon 馃). Sorry for the trouble everyone!
[email protected] has been published
Did your latest release fix the Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">' error? This error exists for some TypeScript users at least.
Hey @alexthegoodman, there can be different reasons for that error message (like not having the typegen present in a place findable by TS config) but an underling library issue has been resolved, yes.
Are you still facing this issue? A working example can be found here.
The example works for me.
like not having the typegen present in a place findable by TS config
I assume you mean the nexus.d.ts and schema.graphql files inside example/src/generated? I understand the example works because the file exists.
But where and how do I generate these typings? Is this something Nexus should do automatically? Where is this configured?
edit: I tested the prisma-examples/typescript/graphql-auth example from the prisma2 branch and it works for me now.
But where and how do I generate these typings?
It occurs async during the makeSchema step. Exposing more control around this and removing need for developers to be aware of the mechanics (so lowering the floor _and_ increasing the ceiling) are anticipated improvements over coming weeks.
Nice :)
Also, @prisma/nexus, nexus-prisma and nexus got me quite confused. The docs are quite outdated but I came to the understanding that nexus-prisma is the Nexus _plugin_, nexus is Nexus _core_ and @prisma/nexus is _deprecated_, right?
What place regarding docs get updated most frequently? prisma/prisma-examples@prisma2, nexus.js.org or prisma/nexus-prisma's README.md?
The docs are quite outdated but I came to the understanding that nexus-prisma is the Nexus plugin, nexus is Nexus core and @prisma/nexus is deprecated, right?
Congratulations you navigated the confusion well!
What place regarding docs get updated most frequently? prisma/prisma-examples@prisma2, nexus.js.org or prisma/nexus-prisma's README.md?
Stay tuned, we'll be doing a sanity pass on docs soon 馃憤
add --transpile-only flag to ts-node resolved the issue. However, I don't know what that flag is doing.
Found the --transpile-only flag skip type-check, which so make sense now why you guys don't get the error. --transpile-only is for the product to not fully support typescript but still can run, so please help fix this.
@chenfanggm you shouldn't need the flag. Or, you may need it once to generate the types needed to typecheck (馃悢 馃 situation).
Hi,
tried [email protected] tonight and it won't recognize t.model nor t.crud. Revert to [email protected] and everything worked again (as it was before the update). Hope this will help, don't hesitate to ask for more details. Good luck, and nice job by the way :-)
Hey @storkweb, you can use 0.5.0 now by the way. You can compare against the examples in this repo which work. If your issue persists we'd be happy to look at a repro repo.
@jasonkuhrt FYI when running the blog example with the following dependencies for me causes this above error:
"dependencies": {
"graphql-yoga": "^1.18.2",
"nexus-prisma": "^0.5.0"
},
"devDependencies": {
"@types/faker": "^4.1.5",
"@types/ws": "^6.0.3",
"faker": "^4.1.0",
"prettier": "^1.18.2",
"prisma2": "^2.0.0-preview015",
"ts-node-dev": "^1.0.0-pre.41",
"typescript": "^3.5.3"
},
when I run with the values in the example by default things were fine. I'm going to see if I can track down the exact issue, but wanted to at least raise this.
I had the same error for example project. Additionally, nexus warned that there is no outputs field in object argument passed to makeSchema. So, firstly, I added that field in src/schema.ts:
export const schema = makeSchema({
//...
outputs: {
typegen: __dirname + '/../generated/typings.ts',
schema: __dirname + '/../generated/schema.graphql',
},
})
After npm run generate:nexus it created specified files. The wanted definiton was in generated/typings.ts:
declare global {
interface NexusGenCustomOutputProperties<TypeName extends string> {
crud: NexusPrisma<TypeName, 'crud'>
model: NexusPrisma<TypeName, 'model'>
}
}
So adding the line
/// <reference path="../generated/typings.ts" />
on the top of src/schema.ts resolved type errors.
Anyway, i am not sure this is correct solution)
Oh, just saw this comment https://github.com/prisma-labs/nexus-prisma/issues/332#issuecomment-522909480
Yep, adding the outputs worked for
me as well!
The solution for me was adding the following
outputs: {
typegen: path.join(
__dirname,
'../node_modules/@types/nexus-typegen/index.d.ts',
),
},
Reinstalling node_modules did the job for me.
Most helpful comment
I had the same error for example project. Additionally,
nexuswarned that there is nooutputsfield in object argument passed tomakeSchema. So, firstly, I added that field insrc/schema.ts:After
npm run generate:nexusit created specified files. The wanted definiton was ingenerated/typings.ts:So adding the line
on the top of
src/schema.tsresolved type errors.Anyway, i am not sure this is correct solution)