I want to alter the mutation using Laravel Creating event. I want to fetch task ID from key that is coming from front end. And then i want to add this ID in replace of key so that my task will be create automatically using lighthouse structure. Here is sample mutation
mutation
{
createUser(input: {
firstname: "last"
email: "[email protected]"
task:
{
create: {
key: 'reminder'
}
}
})
{
id
}
}
My recommendation is to create a resolver for your specific situation:
In your schema.graphql
Here's an example of the resolver: Resolver example
Also check the docs: https://lighthouse-php.com/4.9/api-reference/resolvers.html