You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #232 , I suggested that @BatchMapping should support @Argument, because user will define arguments on field, no matter whether the field is fetched by DataLoader or 'n+1' way. Furthermore, user will always want to get information about field, such as field definition or directives info.
Hence, I think BatchLoaderHandlerMethod should support custom argument resolve strategy which resolving method parameters into argument values, like #295 . BatchMappingDataFetcher should use dataLoader.load(env.getSource(), env);(code like below), and argument resolve strategy and batch handler method will get all the information about the fetched field.
staticclassBatchMappingDataFetcherimplementsDataFetcher<Object> {
......
@OverridepublicObjectget(DataFetchingEnvironmentenv) {
DataLoader<?, ?> dataLoader = env.getDataLoaderRegistry().getDataLoader(this.dataLoaderKey);
if (dataLoader == null) {
thrownewIllegalStateException("No DataLoader for key '" + this.dataLoaderKey + "'");
}
// pass DataFetchingEnvironment to DataLoader and other componentreturndataLoader.load(env.getSource(), env);
}
}
The text was updated successfully, but these errors were encountered:
#298 This pr support for BatchHandlerMethodArgumentResolver. Maybe a later pr could custom BatchHandlerMethodArgumentResolver (similar like #295). Is this a right way
In #232 , I suggested that
@BatchMapping
should support@Argument
, because user will define arguments on field, no matter whether the field is fetched by DataLoader or 'n+1' way. Furthermore, user will always want to get information about field, such as field definition or directives info.Hence, I think
BatchLoaderHandlerMethod
should support custom argument resolve strategy which resolving method parameters into argument values, like #295 .BatchMappingDataFetcher
should usedataLoader.load(env.getSource(), env);
(code like below), and argument resolve strategy and batch handler method will get all the information about the fetched field.The text was updated successfully, but these errors were encountered: