Is it currently possible to choose custom names for generated CRUD-Operations?
E.g. Instead of “deleteUser” I want dgraph to generate a “removeUser” mutation.
Is it currently possible to choose custom names for generated CRUD-Operations?
E.g. Instead of “deleteUser” I want dgraph to generate a “removeUser” mutation.
I don’t think so, will ping @graphql guys.
I’d explore maybe using @lambda
to “alias” a custom name, and then @generate
to not generate the delete
Let me know how it goes.
That would involve running the lambda server, correct?
If you don’t generate the delete
, you won’t be able to use it from the aliased lambda
Yup! but you won’t be able to disable the delete
. It would co-exist with the aliased lambda because of the above reason.
Seems like a new feature request overall.
Yes, I think the same. Thank you for clarification.
out of curiosity, why do we allow people to disable delete mutations?
DQL is still an option to delete things, no?
If you don’t generate the
delete
, you won’t be able to use it from the aliased lambda
Also this is not quite true. You can directly access DQL from inside a lambda
async function foo(({ dql }) {
const results = await dql.mutate(..);
}
lol literally what I just wrote.
Specifically, we never thought about it before. But, I guess, since it is their API, the user should have a freedom to choose what do they want to expose to the clients. And, that’s the only thing I can think
I believe there can be a use-case where a user doesn’t want to expose delete mutations to the client. Like maintaining a change-log, which only gets added, never updated or deleted.
yeah! you can still delete with DQL. Disabling the delete through @generate
will only disable the auto-generated GraphQL mutation. That’s all.