File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ This project is a work in progress. Feedback is encouraged.
1414## Usage
1515``` go
1616// setup batch function
17- batchFn := func (ctx context.Context , keys [] interface {} ) []*dataloader.Result {
17+ batchFn := func (ctx context.Context , keys dataloader. Keys ) []*dataloader.Result {
1818 var results []*dataloader.Result
1919 // do some aync work to get data for specified keys
2020 // append to this list resolved values
@@ -31,7 +31,7 @@ loader := dataloader.NewBatchedLoader(batchFn)
3131 * closure over a value (in this case an interface value and error).
3232 * When called, it will block until the value is resolved.
3333 */
34- thunk := loader.Load (ctx.TODO (), " key1" )
34+ thunk := loader.Load (ctx.TODO (), dataloader. StringKey ( " key1" )) // StringKey is a convenience method that make wraps string to implement `Key` interface
3535result , err := thunk ()
3636if err != nil {
3737 // handle data error
You can’t perform that action at this time.
0 commit comments