Closed orible closed 7 months ago
In this example, it's a UNIQUE 1:1 relationship mapping the user's vote value, to the target thread.
The SQL tables are correctly referenced in foreign keys and the sqlboiler relationship is correct.
Ah yeah that does not work indeed.
I would recommend adding an auto increment id to your table.
We need unique id's for Relay in our Grapql_schema + it's easier to get an object with just an id. Combined primary keys would mean a lot of extra work for the resolvers to work.
Model with composite primary key incorrectly referred to by non existent single field "ID"
Take a model with two primary keys called "ThreadVote" ThreadID UserID CreatedAt Vote
Parts of the generated code incorrectly assumes that it has a single primary key called ID,
For example instead of
dm.ThreadVoteWhere.ThreadID AND dm.ThreadVoteWhere.UserID
It refers to the table by
dm.ThreadVoteWhere.ID.EQ(dbID)
Key translations in mutations are also not generated
For example;
dbID := ThreadVoteID(id)
Does not exist.