小编Ami*_*mir的帖子

How can I extract data from a list of dicts using graphene's mutation method?

I’m trying to created a list of objects using graphql mutation, but have been unsuccessful. I've identified the error, please see code snippets and comment on where the error is propagating.

Note: I'm using Graphene on Flask with Python 2.7

Here’s an example payload:

mutation UserMutation {
    createUser(
        phones: [
            {
                “number”: “609-777-7777”,
                “label”: “home"   
            },
            {
                “number”: “609-777-7778”,
                “label”: “mobile"   
            }
        ]
    )
}
Run Code Online (Sandbox Code Playgroud)

On the schema, I have the following:

class CreateUser(graphene.Mutation):
    ok = graphene.Boolean()
    ...
    phones …
Run Code Online (Sandbox Code Playgroud)

graphql flask-graphql

5
推荐指数
1
解决办法
2005
查看次数

标签 统计

flask-graphql ×1

graphql ×1