web-ridge / gqlgen-sqlboiler

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

ambiguous use of UserIDFromContext #13

Closed troian closed 4 years ago

troian commented 4 years ago

UserIDFromContext seems to be required with 2 different returns types:

Is issue coming from our schema? or it something generated inappropriately?

troian commented 4 years ago
Screen Shot 2020-05-08 at 2 08 31 PM Screen Shot 2020-05-08 at 2 08 11 PM
RichardLindhout commented 4 years ago

I think you should require user id in schema or is this not required in your case?

RichardLindhout commented 4 years ago

So add not nullable in your schema to the user id field

RichardLindhout commented 4 years ago

I add e.g. organizationid/userid to every table to simplify authorization logic. It's built in query since user can not update something outside their scope. But I think it's required for that that user ID and organization I'd are required in table

troian commented 4 years ago

Hm, I think it everywhere is set to NOT NULL

troian commented 4 years ago

Sorry, me stupid. Fixed

RichardLindhout commented 4 years ago

Why does sqlboiler generate a null.String for it. I think it is not set to NOT NULL

RichardLindhout commented 4 years ago

Ah ok! Nice! Maybe we should support it, but I rather like that required in database. But some people do not have the option to require that in an older database so I'll add in the future probably!