It's not often to include more data in a URL, but since each mutation is supported by a function, you do not need to parse its name, you can simply define it in the function.
Because mutations are always top-level, their root object will always be the top-level root object. If you need access to another object, you need to make sure that you provide enough information to receive it.
To track the current user, go to context , one of the initial arguments to run the GraphQL query and the permissions granted in each function. Context is very often used to track a registered user.
Now that you have a function that defines "changeMyUsername", you have a registered user, and you have provided arguments with a new username, you should have everything you need to implement the body of this function.
source share