mghoneimy / php-graphql-client

A PHP library that simplifies the process of interacting with GraphQL API's by providing simple client and query generator classes.
MIT License
302 stars 87 forks source link

Update Mutation #75

Open acamenhas opened 2 years ago

acamenhas commented 2 years ago

Hello,

I didnt see any example or test for a update mutation, how can be implemented this mutation:

mutation MyMutation { update_users(where: {id: {_eq: 1}}, _set: {name: "My name"}) { affected_rows } }

Thank you

VadimNowo commented 2 years ago

I guess you just need to nest queries like:

->setSelectionSet( [ (new Query('collection')) ->setSelectionSet( [ 'id', 'title', 'descriptionHtml', 'handle', 'sortOrder', ] ) ], );