Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add a first implementation for gathering resource ids #94

Merged
merged 8 commits into from
Sep 28, 2020

Conversation

n1ru4l
Copy link
Owner

@n1ru4l n1ru4l commented Sep 17, 2020

This PR modifies the InMemoryLiveQueryStore to wrap schema resolvers that return a NonNull ID Scalar with a resolver that collects the selected resources for an operation.

The gatherId function could is attached to the passed-in contextValue. However, the contextValue can be anything. To workaround that we pass in a new context that wraps the user contextValue. All resolvers are wrapped and will use the correct contextValue for executing the user resolver, while still having access to the gatherId function.

The list of resource ids is then merged with the QueryRoot Field coordinates. This allows triggering a query re-execution on a resource basis. E:g. liveQueryStore.triggerUpdate("Todo:1").

@n1ru4l n1ru4l changed the title add a first implementation for gathering resource id. add a first implementation for gathering resource ids Sep 17, 2020
@n1ru4l n1ru4l marked this pull request as ready for review September 28, 2020 06:59
@n1ru4l n1ru4l merged commit ad5fc2e into main Sep 28, 2020
@n1ru4l n1ru4l deleted the resource-gathering branch September 28, 2020 07:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant