Open Maetes opened 4 years ago
Having the same issue. I realized that nexus 0.26.0 and up, will just not run nor generate the api.graphql file, and that also causes the model/crud objects to not be added into the nexus context. (VS Code does not recognizes the objects, even after restarting TS Server)
With version 0.25.0 the nexus server starts, generates the graphql file but as soon as you try to access it, I get the same issue:
4465 ✕ app unhandledRejection
| error Error: Input Object type PoiCategoryUpdateManyDataInput must define one or more fields.
|
| Input Object type CompanyUserUpdateManyDataInput must define one or more fields.
In my case even if I add all the fields I still can't get the error to go away, and I can see the object has no fields on the prisma generated client:
{\"name\":\"PoiCategoryUpdateManyDataInput\",\"isOneOf\":false,\"fields\":[]},{\"name\":\"PoiCategoryUpdateManyWithWhereNestedInput\",\"isOneOf\":false,\"fields\":[{\"name\":\"where\",\"inputType\":[{\"type\":\"PoiCategoryScalarWhereInput\",\"kind\":\"object\",\"isRequired\":true,\"isList\":false,\"isNullable\":false}]},{\"name\":\"data\",\"inputType\":[{\"type\":\"PoiCategoryUpdateManyDataInput\",\"kind\":\"object\",\"isRequired\":true,\"isList\":false,\"isNullable\":false}]}]},
Well, not sure if it is the same case, but mine just fails when I add any t.crud.updateOneXXXX methods. It just goes right to complain about these missing fields. But it I just leave the queries, then it compiles correctly. Tested with nexus 0.26.1.
import {schema} from 'nexus'
schema.mutationType({
definition(t) {
t.crud.createOneCategory()
// t.crud.updateOneCategory() //This one will triger the issue
t.crud.createOneCompany()
//t.crud.updateOneCompany() //This one will triger the issue
t.crud.createOneCollection()
}
})
I think that upsertOnes will also triger the issue @sfratini t.crud.upsertOnesCategory()
I am not using nexus. but i have the same issue with @nexus/schema 0.14.0 and nexus-prisma 0.13.0
I think that upsertOnes will also triger the issue @sfratini t.crud.upsertOnesCategory()
I am not using nexus. but i have the same issue with @nexus/schema 0.14.0 and nexus-prisma 0.13.0
I just created one specific bug for that and I can confirm the upsert triggers the same issue for me.
Any fix/update on this? I'm facing same issue.
Maybe this is a prisma bug rather than a nexus one.
Nexus Report
Description
I have a m - n relation which does not have any additional meta field in the pivot table. So when there are only the minimal needed columns defined for the relation the error pops up. When i add an additional field all is ok. Example follows:
when modelling the prisma schema like so the error is thrown:
This is okay:
I should be able to define an explicit model also without meta information.