-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument 'where' of '*WhereUniqueInput' needs at least one of 'id' #466
Comments
Accidentally hit the create button before finishing. Editing the description now. |
Are you sure this deserves the label "question"? The fact that I'm receiving an error message telling me to include a field that doesn't exist in my query seems like a bug. I found a way around it before, but I'm running into it again in somewhat different circumstances. |
Is it related to #19? |
I don't think so, but I could be wrong. I've added dummy fields to my many-to-many relation tables to avoid that issue. I will say, in this more recent issue I encountered, I realized I had forgotten to add a unique constraint on the field I was querying by. Once I added it, I was able to proceed. However, I still think it is a problem that the error message tells me to add a field that doesn't exist in the GraphQL API, and I think could generally be more descriptive. I guess in some sense, this does sound like a similar problem to #19, and maybe they have the same underlying cause, but it still seems like a somewhat separate issue. It's not yet clear to me whether this issue only occurs on many-to-many relations, but that has been true in both of the cases I've encountered. This issue also seems to involve On a side note, I also am now a bit confused by the architecture of the generated types/schema here. In particular, the So which of these behaviors is intended? |
Well, I at least figured out why the |
Describe the Bug
I'm trying to use an upsert operation and getting a error that doesn't seem to match what I'd expect on the update side. The error says that I need to specify "one of 'id'" property (which I'm not even sure how to acquire for the given object at this time without submitting another query to the database, but I will if I have to), but there is no 'id' field, either on the generated GraphQL schema or on the generated TypeGraphQL Input class. I have seen a similar error before, but it was legitimate and told me how there were multiple fields, and I was genuinely missing one that was needed. So this behavior is odd in three ways:
These things together lead me to believe that this is indeed a bug.
Note that this is occurring when I'm essentially trying to link two models together through a third model. In my case, it's Tags, Locations, and TagToObjectRelations. The tag field has a multi-field unique constraint for its userId and name.
To Reproduce
I don't have time right at the moment or really until next week, but I will try to make a minimal reproduction repo. For now, the relevant repo is https://github.com/t-rad679/egrim
Here are some relevant pieces of code:
CreateOrUpdateLocationForm.vue
in that reposrc/server/prisma/schema.prisma
in that repoExpected Behavior
Logs
stack trace
Environment (please complete the following information):
typegraphql-prisma
version: 0.27.2Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: