Custom names for CRUD-Operations

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 :grimacing:

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.

1 Like

Yes, I think the same. Thank you for clarification.

1 Like

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(..);
}
1 Like

lol literally what I just wrote.

1 Like

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 :sweat_smile:

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.

3 Likes