Use apoc.create.uuid in the generated create mutations so the user does not need to specify an id at creation time.
If an ID param is provided, then a generated uuid should not be used.
Use @autogenerate directive on ID field in typedef to indicate field should be autogenerated. If @autogenerate is found on an ID field it will not be included as an argument in the create mutation but will be set automatically at creat time.
@johnymontana thanks! That sounds like a big step forward! If I could just ask a few questions...
Regarding that last question, I just want to point out that, since we currently don't have nested updates, our front end will have to wait for the generated id for every creation mutation before requesting anything else that uses that generated id. For instance, given types X and Y, we can't have a single mutation function that uses an id for a CreateX and also for AddXY.
[As I've said elsewhere, I think that the biggest improvement to the package would be to allow for nested mutations. At a minimum, nested creation which supported the calls to Add would profoundly simplify the front end!]
Instead of using directives to drive this we keep the id field nullable and if a value for it is not provided in the mutation then one is generated using apoc.create.uuid, if the id value is provided then no UUID is generated.
Most helpful comment
Use
@autogeneratedirective on ID field in typedef to indicate field should be autogenerated. If@autogenerateis found on an ID field it will not be included as an argument in the create mutation but will be set automatically at creat time.