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

Need of validating Mutation input data using a Form (Based on Mongoengine Document) #168

Open
mahdifarhang opened this issue Mar 2, 2021 · 0 comments

Comments

@mahdifarhang
Copy link

I'm Trying to write a mutation for my model and The problem is how to validate the data that comes from the user.
In Django, which has forms (and modelForms) that you can create dynamically based on a model you have described, this problem is handled beautifully using DjangoFormMutation, with the help of graphene-django package (You can see an example here).
Is there a way for us in this package that help us implement our mongo document mutations this way?
I know we can create an Argument class and handle (and validate) fields there; but using that mechanism, we need to cast each field from graphene data object type to mongoengine document filed manually and that is somehow dirty.
Or more important, is there a way to dynamically generate Argument class Fields from mongoengine document ?

many thanks.

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

No branches or pull requests

1 participant