-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add handling for null earinings #92
Conversation
I'm wondering whether we should be allowing null token amounts at all in that table or in the GraphQL. I feel like it doesn't add anything. What do you think? |
39f76f0
to
dff61d4
Compare
SELECT 'up SQL query'; | ||
|
||
ALTER TABLE rewards | ||
ALTER COLUMN streak_earnings SET DEFAULT 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah crap I think you need to still do an UPDATE rewards …
. Trying to patch this up.
@@ -0,0 +1,25 @@ | |||
-- +goose Up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh one more thing—we try to name this sequentially. I think goose has a command that helps you do that.
This PR fixes 3 related issues.
Our schema has fields with type
BigInt!
which maps to the go type *BigInt if we return a nil value GQL returns the errorthe requested element is null which the schema does not allow
.We had checks for TotalSum being 0, which prevented us from returning other relevant information, such as totalCount.
Our SUM for calculating TotalTokens was adding cols that could be
NULL
. Unlike the SUM function if you call operators like+
onNuLL
they will always returnNULL
.