-
Notifications
You must be signed in to change notification settings - Fork 18
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
Generate artifacts for @updatable
scalars
#325
base: main
Are you sure you want to change the base?
Generate artifacts for @updatable
scalars
#325
Conversation
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.
some nits, then I'll re-review
|
||
ClientFieldParameterType(client_field_parameter_type) | ||
pub struct DualStringProxy<'a> { |
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.
nice, I like this a lot. Let's add a comment to say why we're using this.
However, it's a bit unfortunate that we have to sometimes write through DualStringProxy
, and sometimes let DualStringProxy
drop and write directly to readonly_data_type
and updatable_data_type
.
Maybe we should pass a single object around, query_type_declaration: RegularAndUpdatableQueryTypeDeclaration
, which contains methods:
- write_scalar_field(name, value, is_updatable)
- write_linked_field(name, value, subfields, is_updatable)
or perhaps
- write_linked_field_start(name, value, is_updatable)
- close_linked_field
the object could keep track of the indentation
IMO this gets us closer to what we probably should be doing, which is creating TypeScript ASTs, instead of concatenating a bunch of strings.
Let's make this change ☝️ as a separate PR that has no concept of updatable fields (i.e. just create a QueryTypeDeclaration
object)
@updatable
scalars@updatable
scalars
associated_data | ||
.type_name | ||
.clone() | ||
.map(&mut |_| updatable_data_type.0.clone()), |
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 also don't like recursively cloning two Strings here parameter_type
and updatable_data_type
Follow up to #314
Part of updatable fields #312