Summary of May 30th to June 1st

Laurent Wouters lwouters at
Fri Jun 1 18:29:16 CEST 2018

Dear all,

This is a quick report of the work going on this week (on my end) on CubicWeb. Still on the topic of GraphQL, I have been able to implement mutation queries, i.e. adding, removing and modifying objects. Due to the way GraphQL works I had to make some
choices as to what mutation queries would look like in CubicWeb. On the one hand, mutation queries in GraphQL are closer to stored procedures in spirit (i.e. business specific) than to a general-purpose language such as SQL or RQL on this aspect. On the
other hand, the aim was to provide a consistent implementation of GraphQL in CubicWeb regardless of the used YAMS schema. In the end, I opted for a simple approach as follow :

Reading queries makes entities unsurprisingly accessible through things like : Personne { firstname, surname }, etc.

The creation of new entities is written as : createPersonne(firstname: "john", surname: "doe").

The deletion of entities is expressed in a boringly similar fashion as : deletePersonne(firstname: "john"), which would delete any Personne entity with the matching attribute.

Finally, updating entities is written as : updatePersonne(old: {firstname: "john"}, new: {firstname: "jane"})

It is important to realize that all these expressions relies on a typed GraphQL data model for queries that is generated from the current YAMS schema at runtime. In addition, the resolution of all mutation queries is realized through the generation of a
nicely corresponding RQL statement.

The code for this change is accessible at

You can find examples of real queries in the tests at

I will push this change for review on this list once it is ready with additional tests, probably at the beginning of next week.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the cubicweb-devel mailing list