Migrated rpdata-api to using go modules and a more recent version of
the build was successful

gqlgen

Squashed commit of the following:

commit 162ccf6bfb
Author: Gisle Aune <dev@gisle.me>
Date:   Fri May 17 11:51:23 2019 +0200

    The great module madness continus, now with pointers.

commit 7e3dc49635
Author: Gisle Aune <dev@gisle.me>
Date:   Thu May 16 15:57:08 2019 +0200

    Basic stuff, doesn't compile
This commit is contained in:
2019-05-17 12:20:08 +02:00
parent aff0d99842
commit e794311eb8
31 changed files with 424 additions and 511 deletions
+5 -5
View File
@@ -11,13 +11,13 @@ import (
)
// Channel gets a character by key
func (loader *Loader) Channel(key, value string) (models.Channel, error) {
func (loader *Loader) Channel(key, value string) (*models.Channel, error) {
if !strings.HasPrefix(key, "Channel.") {
key = "Channel." + key
}
if loader.loaders[key] == nil {
return models.Channel{}, errors.New("unsupported key")
return nil, errors.New("unsupported key")
}
loader.loadPrimed(key)
@@ -25,15 +25,15 @@ func (loader *Loader) Channel(key, value string) (models.Channel, error) {
thunk := loader.loaders[key].Load(loader.ctx, dataloader.StringKey(value))
res, err := thunk()
if err != nil {
return models.Channel{}, err
return nil, err
}
channel, ok := res.(models.Channel)
if !ok {
return channel, errors.New("incorrect type")
return nil, errors.New("incorrect type")
}
return channel, nil
return &channel, nil
}
// PrimeChannels primes channels for loading along with the first one.