Open aaronwng opened 4 years ago
generated/nexus.graphql
type group {
comment: String
id: Int!
name: String
user(cursor: userWhereUniqueInput, skip: Int, take: Int): [user!]!
}
type user {
comment: String
crisp: String
email: String
group: Int
groupInfo: group
id: Int!
lastLogin: Int!
username: String?
}
I finally found out that's because the unique identifier id
starting from 0.
If I run Query with id: 1,
query{
group(where:{id:1}){
user{
username
}
}
}
it works fine, while if I run Query with id: 0, it just throws out this error
query{
group(where:{id:0}){
user{
username
}
}
}
I thought we need to keep it normal even thought the id starting from 0.
I thought we may need to change this statement to
if(!data.hasownproperty(indentifier)){
So that we don't even miss situation when data[identifier] equals false
I have the same problem with nexus-plugin-prisma@0.35.0
throw new Error(`Unable to resolve a unique identifier for the Prisma model: ${model.name}`)
I ran into the same issue and was able to solve it by adding a @@unique
command to the failing schema. Not a solution, but something to experiment with.
@julia-dizhak did you find any solution to the problem?
It's affecting us too, @styxlab's comment was a fix for us too. It seems to create a new unique index in an SQL migration, but that shouldn't be needed and seems redundant. Would be great to hear if this is actually an intended update or if it'll get fixed. Thanks!
I have no idea why the relation can't be solved.
Graphql Error
Query
schema.prisma
I just follow https://github.com/graphql-nexus/nexus-schema-plugin-prisma/issues/339#issuecomment-609782477 to set the schema.js