Skip to content
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

Sqlite backend broken from campaigns query #817

Closed
schuyler1d opened this issue Aug 28, 2018 · 3 comments
Closed

Sqlite backend broken from campaigns query #817

schuyler1d opened this issue Aug 28, 2018 · 3 comments
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

Comments

@schuyler1d
Copy link
Collaborator

schuyler1d commented Aug 28, 2018

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.

@schuyler1d schuyler1d added C-bug Type: Bug help wanted E-easy 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 good first issue labels Aug 28, 2018
@dzeez
Copy link
Contributor

dzeez commented Aug 29, 2018

working on this

@ibrand
Copy link
Collaborator

ibrand commented Sep 2, 2019

@dzeez and @shakalee14 looks like this was merged on Sep 12th 2018. Did that PR fully address this issue? If so, I'm going to close.

@ibrand
Copy link
Collaborator

ibrand commented May 15, 2020

Closing this since this is no longer a problem -- there happens to be another error causing campaigns not to load on sqlite at the moment, but that's unrelated

@ibrand ibrand closed this as completed May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants