{
"errors": [
{
"message": "Field \"updatePerson\" of type \"UpdatePersonPayload\" must have a selection of subfields. Did you mean \"updatePerson { ... }\"?",
"locations": [
{
"line": 2,
"column": 3
}
]
}
]
}
But this is what the tutorial provides. If I add some fields to the mutation I then get another error
{
"message": "mutation updatePerson failed because Dgraph execution failed because Got unsupported type for list: Person.manages",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"updatePerson"
]
}
],
"data": {
"updatePerson": null
}
}
If I replace remove: { manages: null } by remove: { manages: [] } it no longer yells at me, but I’m not sure it does what it’s supposed to do, meaning remove all edges
It’s not possible to do it the way you’re doing it. If you found this in any tutorial or documentation please point it out to me so I can fix it.
GraphQL is a hard typed language. Everything has to be described explicitly. To delete something you need to point to what you want to delete. That is, you have to pass a list of XIDs to perform the deletion. There is no “delete all * *” in GraphQL. It could be done, but it is a separate and more complex engineering. Which is not part of the GraphQL specification.
This is what the tutorial says. @MichelDiz I can’t see how I could have been more explicit than when I said I even gave the page number on the tutorial
I’m following tutorial Dgraph GraphQL Tour SCHEMA and when I try
the provided mutation below it returns an error (page 7 of tutorial)
Then it means that you can’t remove edges without knowing to which node those edges are connected to if I understand correctly Deleting Data | Graphqlschema | Dgraph Tour. It doesn’t make much sense to me …
I believe you skipped over some parts of what I said. But, The GraphQL Tour was created by a third party, a contractor. They may have made a mistake and the reviewer didn’t catch that part. Or, as I mentioned above, there was support for that method but we had a regression. Try downloading version 21.12 and see if it works. If it does, then my theory is correct.
I believe you skipped over some parts of what I said.
I don’t think I did, I’m using the Tour tutorial so I can’t really choose which version to choose. But I’ll try locally with the version you gave me.
But, The GraphQL Tour was created by a third party, a contractor
I don’t think you’ve told me that before but okay
They may have made a mistake and the reviewer didn’t catch that part. Or, as I mentioned above, there was support for that method but we had a regression. Try downloading version 21.12 and see if it works. If it does, then my theory is correct.
That was not a mistake at the time, it was a change undocumented by the developers. Yes, I am sure because I wrote that GraphQL and tested it throughly.
You use to be able to do this, but changed in I think 21.03 maybe?
@cscetbon thanks for pointing this discrepancy between the Tour and the current version.
We are actively revamping the Dgraph documentation including the tutorials (as we have tutorials at different places), Doc team will re-test and update the Tour.
Fixed in the future or the bug accepted as a “feature”, TBD…
I would rather see it fixed as the user case is still needed and there is no other way around to do a SP* delete except with DQL now. But we’ll have to wait and see if the bug is fixed or the documentation/tour is changed to accept this bug. Only time will tell.
Someone accepted it as a bug, but I think that was the old team, and that bug status appears to have been lost.