0

I am building a graphql API using HotChocolate on ASP.NET.

I have two types, role as well as permission. permission consists of an id, a name and a description. role is almost the same, but it contains a list of permission's. I have already figured out how to create a permission together with a role. Now I need to create a role without creating another permission, instead using an already existing permission in the list of permission's attribute of the new role. I can't seem to figure out how to do it.

Surely there must be a way to do that without creating a whole new mutation for this, right?

1 Answers1

0

I would just create another mutation for it.

It is best practice to have very specific mutations. Checkout the GitHub GraphQL API as a reference.

Pascal Senn
  • 1,712
  • 11
  • 20