web-ridge / gqlgen-sqlboiler

This is a plugin for gqlgen to generate converts + filter queries and resolvers for sqlboiler
MIT License
74 stars 13 forks source link

IDToRemove should be send as pointer #32

Closed troian closed 4 years ago

troian commented 4 years ago
{"level":"error","error":"obj type should be *Type, *[]Type, or *[]*Type but was \"[]boilergql.RemovedStringID\"","time":"2020-05-22T20:19:54Z","message":"could not delete dealSearchStates"}

Generated code is

    var IDsToRemove []boilergql.RemovedStringID
    if err := dm.UserSocials(mods...).Bind(ctx, r.db, IDsToRemove); err != nil {
        log.Error().Err(err).Msg(publicUserSocialBatchDeleteError)
        return nil, errors.New(publicUserSocialBatchDeleteError)
    }

expected code

    var IDsToRemove []boilergql.RemovedStringID
    if err := dm.UserSocials(mods...).Bind(ctx, r.db, &IDsToRemove); err != nil {
        log.Error().Err(err).Msg(publicUserSocialBatchDeleteError)
        return nil, errors.New(publicUserSocialBatchDeleteError)
    }
RichardLindhout commented 4 years ago

Can you make a PR for this? Code is in resolver.gotpl.

I don't have the use-case yet, so I did not test this feature yet :-D. Ideally we should automatically test the output if works end-to-end.

RichardLindhout commented 4 years ago

Fixed in v2.1.2

troian commented 4 years ago

Sorry, I had a first relaxing weekend for a long while. Thanks for the fix!