-
Notifications
You must be signed in to change notification settings - Fork 20
generate client pointers entrypoints #506
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
base: main
Are you sure you want to change the base?
generate client pointers entrypoints #506
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.
Mind if we hop on a call so that I can understand what's going on? TBH I'm a bit lost, but it could be cause I'm really tired 😅
pub struct PathToClientPointer { | ||
pub linked_fields: Vec<NormalizationKey>, | ||
pub field_name: ClientObjectSelectableName, | ||
pub parent_selectable_key: ClientSelectableKey, |
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.
What is this struct going to be used for? I'm not sure I follow, in particular, what the parent_selectable_key
is going to be used for
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.
Sure, we can hop on call
20a7f92
to
c3485dd
Compare
This looks really clean |
ce57b31
to
4910884
Compare
This is fully working! 😄 |
Omg I didn't notice your comment!!! Yes!!!! I should be able to finally get through the backlog tomorrow or next week Once this lands and we add some uses of it in our demos, let's cut a release 😎 |
4910884
to
712fae8
Compare
uncommited changes do stuff Uncommited changes format changes stuff do do
87b92dc
to
a0fc693
Compare
@@ -64,6 +66,7 @@ pub struct RootRefetchedPath { | |||
pub enum MergedServerSelection { | |||
ScalarField(MergedScalarFieldSelection), | |||
LinkedField(MergedLinkedFieldSelection), | |||
ClientPointer(MergedLinkedFieldSelection), |
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.
did we discuss this? I'm a bit worried that this is the wrong move here, but TBH I feel like I would have noticed this and commented on it in the past.
Okay, so what's happening here (lol I'm literally prompting myself like I'm an LLM):
- scalar server fields, object server fields and client pointers exist in the same namespace, so there's no chance of a conflict here, that's fine
- this flows into the reachable variables. These flow into
get_used_variable_definitions
, so I think that's fine. Because if a variable is used in a client pointer, but not elsewhere, it should show up as a required parameter of the client pointer's loadable field type. (Does it??)
Okay, so as far as I can tell, it's not obviously broken. But does it belong? There are a few places we ignore this variant. Maybe that's indicative of it not belonging.
Okay, let's chat about this sometime.
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 did it this way so it's easy to traverse in current_target_merged_selections
when client pointer or refetch is in another pointer
Stuff to be done:
entrypoint__0.ts
has__refetch__0__0.ts
,__refetch__0__1.ts
, etc.)I'd like feedback if what I've done so far seems correct
The main idea here was:
FieldToCompletedMergeTraversalStateMap
stores a single entry, the merged selection set is the same for loadable and regular fieldsreader_selection_set
and an entry for each loadable since they have different merged selection setsThat's why I replaced
ClientObjectSelectableId
inFieldToCompletedMergeTraversalStateMap
with new typeClientSelectableKey
.The
ClientSelectableKey
is a tuple of theClientObjectSelectableId
and either:None
- this is non loadable selectionSome(path)
- this is loadable selection under some path, the path has aparent
pointing to different key in the mapSo far I've only tested this with query below and it seems to generate correct (besides the bugs above) entrypoints, and refetch query.
Part of #53