You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea was that re-introspection should only keep custom names if it is the same PK. With this change the custom name fullName for your API would stay the same even if you move the PK from (firstName, lastName) to let's say (firstName, age). This makes it easier for the user since they will have fewer needed code changes, but is also a bit dirtier I think.
And another weird behaviour this would introduce if I read the PR correctly is that if you go from a compound with a name property to a singular PK (which technically should not have a name property) this would transfer the name into the datastructure. It cannot be rendered though, but might cause trouble down the line at some point. So I'd at least prevent that.
My understanding would be that in this case @janpio , it's the same pk, so the name is preserved. If any of the fields changed, then the name would be gone, according to the explanation by @do4gr in my last reply.
But wasn't my reproduction the original issue here? If there is another case where this is not the case, we might want to clarify that in a new issue (or just document this as how it works).
Activity
Make @id(name: ...) reintrospectable in more cases
tomhoule commentedon Sep 3, 2021
Explanation from @do4gr on slack:
Let's close prisma/prisma-engines#2205 and keep current behaviour for now.
janpio commentedon Jan 3, 2022
Seems this is not the case any more:
becomes
Does this make sense @tomhoule @do4gr?
tomhoule commentedon Jan 3, 2022
My understanding would be that in this case @janpio , it's the same pk, so the name is preserved. If any of the fields changed, then the name would be gone, according to the explanation by @do4gr in my last reply.
janpio commentedon Jan 4, 2022
But wasn't my reproduction the original issue here? If there is another case where this is not the case, we might want to clarify that in a new issue (or just document this as how it works).
Druue commentedon Aug 17, 2023
Yeah, this no longer occurs

Workflow: