Removed to and from predicates from Message type and schema pushed schema successfully. (Although the underlying Dgraph predicates remains)
Readded the to and from predicates for the new schema and same error. (as expected due to Dgraph predicates not actually being deleted)
Went and looked in Ratel for the Message.to predicate to see if something really was there and didn’t get deleted with my mutation above… Nope, no data there:
IMO, this should be an allowed schema change because there is no data stopping the change. I understand preventing it while there is data for the predicate, but somehow that is not being cleared.
@ashishgoswami
This is in error is in dgraph itself . If i DROP DATA then it’s working but with only delete it’s not working.
i reproduced it with following steps in dgraph.
Any update on this? We are using Slash now and running into this error. I can fix it by running some DQL update, but it would be nice to fix it in Slash UI.
EDIT: No I cannot
fix it by running some DQL update
because:
Please note that Slash GraphQL does not allow you to alter the schema or create new predicates via GraphQL±. You will also not be able ta access the /alter endpoint or it’s gRPC equivalent. Please add your schema through the GraphQL endpoint (either via the UI or via the Admin API), before accessing the data with GraphQL±.
We are looking at this along with another issue which allows you to drop a field or drop all the data from the Slash UI itself. @akashjain971 was looking into providing the support in UI.
Alter isn’t exposed to Slash GraphQL users right now because the user while using Alter can end up modifying with the underlying schema in ways that can cause the GraphQL API to break.
I am working on providing a UI utility in the frontend settings page which will allow users to delete data. Slash will not expose the alter endpoint directly but it will accept delete request on another endpoint and internally call the admin endpoint.
Couldn’t we expose the alter endpoint, but limit certain functionalities like modifying GraphQL schema / shutdown and such? I doubt there’s much point in introducing another endpoint, which would have to play catchup to the admin endpoint forever.
That would require changes in Dgraph to provide restricted access. Slash already has a new endpoint(/admin/slash) to talk to Dgraph’s admin endpoint for export. I will be using the same endpoint and accept a delete query.
As @amaster507 I’ve deleted all the elements that were blocking this change and I’m still having the same isue
"resolving updateGQLSchema failed because rpc error: code = Unknown desc = succeeded in saving GraphQL schema but failed to alter Dgraph schema - GraphQL layer may exhibit unexpected behaviour, reapplying the old GraphQL schema may prevent any issues: Schema change not allowed from scalar to uid or vice versa while there is data for pred ...."
In ratel, it is possible to drop the infos attached to the predicate that’s giving the error. That fixes the issue.
On the other hand… I think that once we delete all the data by mutations, the schema should be able to change without doing this manual operation or requiring DQL