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

Better error handling for incorrect sql #10108

Closed
kirrg001 opened this issue Nov 6, 2018 · 0 comments · Fixed by #10159
Closed

Better error handling for incorrect sql #10108

kirrg001 opened this issue Nov 6, 2018 · 0 comments · Fixed by #10159
Assignees
Labels
affects:api Affects the Ghost API server / core Issues relating to the server or core of Ghost

Comments

@kirrg001
Copy link
Contributor

kirrg001 commented Nov 6, 2018

If you pass a wrong GQL/NQL filter, Ghost should catch this error and return a proper bad request error.

The error handling should probably happen in the model layer.

e.g. you send an invalid filter syntax, you get a 500

Ghost :master

@kirrg001 kirrg001 added server / core Issues relating to the server or core of Ghost affects:api Affects the Ghost API NQL labels Nov 6, 2018
@kirrg001 kirrg001 self-assigned this Dec 7, 2018
kirrg001 added a commit that referenced this issue Dec 11, 2018
refs #10105, closes #10108, closes #9950, refs #9923, refs #9916, refs #9574, refs #6345, refs #6309, refs #6158, refs TryGhost/GQL#16

- removed GQL dependency
- replaced GQL with our brand new NQL implementation
- fixed all known filter limitations
- GQL suffered from some underlying filter bugs, which NQL tried to fix
- the bugs were mostly in how we query the database for relation filtering
- the underlying problem was caused by a too simple implementation of querying the relations
- mongo-knex has implemented a more robust and complex filtering mechanism for relations
- replaced logic in our bookshelf filter plugin
- we pass the custom, default and override filters from Ghost to NQL, which then are getting parsed and merged into a mongo JSON object. The mongo JSON is getting attached by mongo-knex.

NQL: https://github.com/NexesJS/NQL
mongo-knex: https://github.com/NexesJS/mongo-knex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:api Affects the Ghost API server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant