Adding a DataLoader without the Annotation? #1685
-
Hello trying to setup a dataloader with slightly different options than default so I made my own bean. Mainly trying to utilize the cacheMap feature. This works to a point but now
Im having trouble making sure this dataloader is added to the the DgsDataLoaderRegistry, ultimately i cant use the "DgsDataLoader" annotation because that tries to make a second bean, and I dont see a way to add the "name" or be picked up here by the DgsAutoconfiguration. Would love some insight on the best path forward. Essentially all I want to do is set options for a DgsDataLoader. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 14 replies
-
Hi @evanmalmud - we don't currently have a way to customize with your own dataloader unfortunately. This is the case with both 5.x and later releases. We will need to implement support for this feature by enhancing the existing @DgsDataloader annotation to allow the cache map to be configurable. We can consider adding that in a future release, but due to other priorities we won't be able to deliver this at the moment. Feel free to open a PR and we'd be happy to review it. |
Beta Was this translation helpful? Give feedback.
-
Thanks to @srinivasankavitha you can now override options for dataloaders by making a DgsDataLoaderOptionsProvider bean Create an implementation of DgsDataLoaderOptionsProvider
Create a bean of this class that will be automatically picked up by DGS
|
Beta Was this translation helpful? Give feedback.
-
Hi @evanmalmud |
Beta Was this translation helpful? Give feedback.
Thanks to @srinivasankavitha you can now override options for dataloaders by making a DgsDataLoaderOptionsProvider bean
Create an implementation of DgsDataLoaderOptionsProvider
Create a bean of this class that will be automatically picked up by DGS