Sqlite backend broken from campaigns query #817
Labels
A-database
Area: DB related changes including but not limited to knex, and ORM like structures
A-server-side (nodejs)
Area: All changes on the server side
C-bug
Type: Bug
E-easy
Using sqlite as a backend, loading a campaign from the admin screen (or anywhere that dueBy or createdAt is passed) yields a graphQL 'field is not a Date' value error. (Create a campaign, then go to the 'campaigns' section and see that campaigns don't load)
This is likely due to
66c7a51 in organization.js where it moves from the rethink-knex-adapter to a pure knex select('*') and thus does not convert date fields.
It probably needs to either implement a custom
dueBy
method instead of relying on the generic mapFieldsToModel (i.e. add a method and then convert any integer into a date type) OR refactor the changes to the db query back to rethink-knex-adapter getAll, etc.https://github.com/MoveOnOrg/Spoke/blob/main/src/server/api/campaign.js#L74
cc @lperson @harpojaeger for philosophical thoughts on best practices here.
The text was updated successfully, but these errors were encountered: