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
intro: Handle relation field introspection using the pair setup #3468
Conversation
ad223a0
to
e3a9c69
Compare
d7a00d7
to
746bd5a
Compare
@@ -1,7 +1,9 @@ | |||
use super::scalar_field; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the messy diff. Moved the single model rendering to a separate function.
746bd5a
to
a8f5524
Compare
a8f5524
to
e39e066
Compare
e39e066
to
94110fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a lot of code so hard to review, but I think I got the hang of it, looks good 👍
@@ -279,9 +411,11 @@ pub fn calculate_datamodel( | |||
introspection_map: &introspection_map, | |||
}; | |||
|
|||
let introspection_map = crate::introspection_map::IntrospectionMap::new(input); | |||
input.introspection_map = &introspection_map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we are creating the introspection map twice in this function. Maybe we should make IntrospectionMap::new()` into something that mutates the input instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input takes a reference... That's a bit of an issue. Let's see that later.
} | ||
|
||
let rendered = if input.render_config { | ||
let psl_string = if input.render_config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes: prisma/prisma#16547