-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Provide parentType to addMany subscriptions #678
Conversation
The parentType in addFieldSubscription was hardcoded to 'asdf'. This causes issues when using multiple nested @list directives, as using the [ListName]_(insert|remove|toggle) operations with @parentID attempted to look for a parent with type 'asdf'. Signed-off-by: Jonas Jacobsen <[email protected]>
Route for testing nested lists has been added to e2e/sveltekit, Modles have been added to the e2e/_api GQL schema, and a simple "database" with sample data has been added to the resolvers. Signed-off-by: Jonas Jacobsen <[email protected]>
🦋 Changeset detectedLatest commit: 3a9f2b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@Joklost is attempting to deploy a commit to the HoudiniGraphQL Team on Vercel. A member of the Team first needs to authorize it. |
Signed-off-by: Jonas Jacobsen <[email protected]>
Any suggestions for the End-to-End (windows-latest) failing?
|
@Joklost I don't know why it timed out. I just relaunched it, and it seems good now. Maybe in e2e tests, you could move your operations files under I don't have time to really look now the PR, but it looks really promising already. Thx a lot for the effort. 🥳 |
Hmm, alright - thanks!
Sounds good - I will move them |
Operation files only used by src/routes/stores/nested-list are now placed appropriately. Signed-off-by: Jonas Jacobsen <[email protected]>
@@ -175,14 +176,15 @@ export class InMemorySubscriptions { | |||
key, | |||
selection: fieldSelection, | |||
spec, | |||
parentType: 'asdf', |
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.
🤦♂️
Thanks for updating this! The referenced ticket won't be fixed by this unfortunately because the issue is a bit more general - the full page parameters won't be sent with the query so loading one page in a list will destroy the other one |
@@ -0,0 +1,98 @@ | |||
<script lang="ts"> |
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.
Wow!! I really appreciate this test. Super thorough!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
// insert the subscriber | ||
this.addMany({ | ||
parent: linkedRecord, | ||
selection: fields, | ||
variables, | ||
subscribers, | ||
parentType: linkedType, |
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.
Actually, could you add a test that covers this?
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.
As far as I understand, this is already covered in the e2e page, as this is what fixed the innermost list (Books) in the test.
If more is needed, I'll definitely take a look.
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.
yea your e2e definitely covers it but I'd like to duplicate the verification. the cache is a big risk in when refactoring so i'd like to make sure the test suite covers as much as possible so we can get quick feedback when working on it
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.
Alright, I'll look into it - thanks
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.
thank you for the time!
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.
Hi,
I have added a pretty verbose, but simple, test in 3a9f2b5. I am pretty new to these frameworks, so I just attempted to mimic the behaviour I saw when running the e2e test, and added it here.
Please let me know if I should further expand the test.
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.
No worries at all about the verbosity! I'd rather that than have no test at all. I'm going to pull down your PR and confirm that test fails without your fix and then it should be good to go. Thanks again!
PS: I might need you to reopen the PR to kick off the CI/CD stuff. Github Actions have been struggling recently
Adds a simple test for testing data with nested lists. The test adds the cities/books/libraries database to the cache, and adds first a city, then a library. Next, a subscription is added, before adding a book to the cache, and it is verified that the book is added to the library. Signed-off-by: Jonas Jacobsen <[email protected]>
Damn, doesn't look like that did it. Mind closing this PR and opening another one? |
Partially fixes #360
The parentType in addFieldSubscription was hardcoded to 'asdf'. This causes issues when using multiple nested @list directives, as using the [ListName]_(insert|remove|toggle) operations with @parentID attempted to look for a parent with type 'asdf'.
To help everyone out, please make sure your PR does the following:
pnpm run tests
andcd integration && pnpm run tests
pnpm changeset