Skip to content

Instantly share code, notes, and snippets.

@kijanowski
Created September 29, 2019 18:24
Show Gist options
  • Save kijanowski/41ac63809a5a3a7a9fe92a88a277e2a8 to your computer and use it in GitHub Desktop.
Save kijanowski/41ac63809a5a3a7a9fe92a88a277e2a8 to your computer and use it in GitHub Desktop.
@Bean
@Scope(value = WebApplicationContext.SCOPE_APPLICATION, proxyMode = ScopedProxyMode.TARGET_CLASS)
@Profile("global")
public DataLoaderRegistry globalDataLoaderRegistry() {
DataLoaderRegistry dataLoaderRegistry = new DataLoaderRegistry();
DataLoader<String, CountryTO> countryLoader = DataLoader.newDataLoader(graphQLDataFetchers.countryBatchLoader());
dataLoaderRegistry.register("countries", countryLoader);
return dataLoaderRegistry;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment