-
Notifications
You must be signed in to change notification settings - Fork 0
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
fixes result parsing for observeQuery, onCreate, onUpdate, and onDelete operations #318
Conversation
🦋 Changeset detectedLatest commit: 183be1c The changes in this PR will be included in the next version bump. 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 |
const { client, spy } = await getMockedClient('getTodo', selectionSet); | ||
const { client, spy } = await getMockedClient('getTodo'); |
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.
A few lines here are just cleaning up a param that wasn't ultimately used.
Pretty sure this is OK. But, converting back to draft until I can confirm next week that we have tests for the opposite case — if custom selection set is not present, we want to ensure the lazy loaders are created. If test cases for this don't exist, I'll add them next week. Update: New lazy loading tests have been added. |
Issue #, if available:
Addresses part of this issue: aws-amplify/amplify-js#13267
Description of changes:
Prior to this PR, subscription-like operations incorrectly handled nested models in graphql responses from custom selection sets. These operations would replace child properties with lazy loaders even when relationships were eagerly loaded.
This PR fixes the problem and adds tests to verify for each operation that:
items
properties flattenedBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.