Hi Sandeep,
We can get the UIDs in both conditions, but in different parts of the “resp” variable. If the nodehas already been created, the uid will be in the response json and needs to be picked from there. This is documented here. Quoting from the doc:
If we run the same mutation again, the data would just be overwritten, and no new uid is created. Note that the uids map is empty in the result when the mutation is executed again and the data map (key q ) contains the uid that was created in the previous upsert.