Skip to content

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

Open
@mahdifarhang

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions