vektah / dataloaden

go generate based DataLoader
MIT License
530 stars 79 forks source link

Rework the type system #28

Closed vektah closed 5 years ago

vektah commented 5 years ago

This is a pretty large refactor of dataloaden that allows arbitrary types for keys and values.

This removes -slice and -key entirely, and replaces them with 3 mandatory positional arguments:

Unlike before with -slice and -ptr these can be nested arbitrarily deeply, for example *[][][]*github.com/my/damn.User is now valid.

for example what used to be

dataloaden -keys int -slice github.com/vektah/dataloaden/example.User   

is now

dataloaden UserSliceLoader int []github.com/vektah/dataloaden/example.User

Replaces https://github.com/vektah/dataloaden/pull/24 Fixes https://github.com/vektah/dataloaden/issues/20

codecov[bot] commented 5 years ago

Codecov Report

Merging #28 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #28   +/-   ##
=======================================
  Coverage   85.57%   85.57%           
=======================================
  Files           2        2           
  Lines         104      104           
=======================================
  Hits           89       89           
  Misses         15       15
Impacted Files Coverage Δ
example/user.go 0% <ø> (ø) :arrow_up:
example/userloader_gen.go 94.68% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0f86e10...a19b9a6. Read the comment docs.