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

Input validation #86

Open
robross0606 opened this issue Aug 5, 2019 · 3 comments
Open

Input validation #86

robross0606 opened this issue Aug 5, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@robross0606
Copy link

Does cruddl support any type of input validation and/or munging hooks or other mechanisms to ensure that mutation input is valid prior to operating against the back end database?

@Yogu
Copy link
Member

Yogu commented Aug 9, 2019

No, currently, there no validation except the standard GraphQL type validation. Validation is on the roadmap for the next months, but we're not sure yet how exactly this will be implemented and if it will be available without further set-up for all cruddl users.

@Yogu Yogu added the enhancement New feature or request label Aug 9, 2019
@robross0606
Copy link
Author

I can understand the desire to express validation with special semantics (directives, json, etc.). However, as a starting point, it would be nice to at least have a way to hook into the code to express validation logic as a callback or something like that.

To clarify, there are no means of interjecting JS code along the path between the GraphQL call and ArrangoDb. It is basically a straight-line between the GraphQL and AQL?

@Yogu
Copy link
Member

Yogu commented Aug 17, 2019

cruddl does not have a plugin architecture and does not offer hooks. However, it allows you to specify your own database adapter. They have a fairly simple API: You just need to implement one method that executes a "query tree", which is a representation of the things to be done and to be queried.

It's probably not a good way to implement input validation, but if you want to alter the query tree before it's processed by the database adapter, you could extend / wrap the ArangoDBAdapter, override executeExt and alter the queryTree before passing to the original method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants