-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enable DataLoader nesting/chaining #3872
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: master
Are you sure you want to change the base?
Conversation
…ted/chained DataLoader calls
Test Results 313 files + 1 313 suites +1 2m 25s ⏱️ + 1m 32s Results for commit 81c4b09. ± Comparison against base commit ea9104d. This pull request removes 206 and adds 219 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
src/main/java/graphql/execution/instrumentation/dataloader/DataLoaderCF.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/execution/instrumentation/dataloader/DataLoaderCF.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/execution/instrumentation/dataloader/DataLoaderCF.java
Outdated
Show resolved
Hide resolved
...in/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java
Outdated
Show resolved
Hide resolved
...in/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java
Outdated
Show resolved
Hide resolved
...in/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java
Outdated
Show resolved
Hide resolved
...in/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java
Outdated
Show resolved
Hide resolved
src/main/java/graphql/execution/DataLoaderDispatchStrategy.java
Outdated
Show resolved
Hide resolved
...main/java/graphql/execution/instrumentation/dataloader/DataLoaderDispatchingContextKeys.java
Outdated
Show resolved
Hide resolved
...in/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java
Show resolved
Hide resolved
...in/java/graphql/execution/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategy.java
Outdated
Show resolved
Hide resolved
...on/instrumentation/dataloader/PerLevelDataLoaderDispatchStrategyWithDeferAlwaysDispatch.java
Outdated
Show resolved
Hide resolved
src/test/groovy/graphql/execution/instrumentation/dataloader/DataLoaderPerformanceTest.groovy
Show resolved
Hide resolved
...main/java/graphql/execution/instrumentation/dataloader/DataLoaderDispatchingContextKeys.java
Outdated
Show resolved
Hide resolved
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.
This is a breaking change for tests
@Override | ||
public <K, V> @Nullable DataLoader<K, V> getDataLoader(String dataLoaderName) { | ||
return dataLoaderRegistry.getDataLoader(dataLoaderName); | ||
return new DataLoaderWithContext<>(this, dataLoaderName, dataLoaderRegistry.getDataLoader(dataLoaderName)); |
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.
This code creates a new object every time its called
If code was to call this N time inside the same DFE then it would create new object each time which seems wasteful
Can we have a map inside the DFE (or a component class that holds that) which remembers which DataLoaderWithContext object it has made.
Perhaps a DataLoaderWithContextFactory
which is just the wrapper of the map and with enough knowledge to know what represent a proper key (its more than data loader name I suspect)
enabling scheduling of nested/chained DataLoader calls