mutation{
createPayment(p_obj={"bob": 80, "job": 100}){
<fields here>
}
}
What I could find was to accept a list of objects as input like:
[ {username: "bob", "amount": 80}, {username: "job", "amount": 100} ]
mutation{
createPayment(p_obj={"bob": 80, "job": 100}){
<fields here>
}
}
What I could find was to accept a list of objects as input like:
[ {username: "bob", "amount": 80}, {username: "job", "amount": 100} ]
You can do something like this -
class PaymentInputType(graphene.InputObjectType):
username = graphene.String()
amount = graphene.Int()
And use the InputType inside your mutation as following.
class CreatePayment(graphene.Mutation):
class Arguments:
input = PaymentInputType(required=True)
ok = graphene.Boolean()
@staticmethod
def mutate(root, info, input):
# save the changes here
return CreatePayment(ok=True)