dataloadgen icon indicating copy to clipboard operation
dataloadgen copied to clipboard

Loading values which do not have comparable indices

Open KevinJTaylor opened this issue 1 year ago • 1 comments

Basically it is difficult to create a loader for an index which is not comparable such as github.com/google/uuid. I believe I need to convert the uuid to/from a string and when loading data (via a query), unless I am missing something?

Loader[KeyT comparable, ValueT any]

NewLoader[KeyT comparable, ValueT any](...)

KevinJTaylor avatar May 01 '24 06:05 KevinJTaylor

The keys have to be comparable because they are used as map keys to deduplicate requests. But the uuid type is [16]byte, so it should be comparable https://pkg.go.dev/github.com/google/uuid#UUID. Which type are you running into issues with?

vikstrous avatar May 15 '24 18:05 vikstrous