I'm struggling to see to add custom rules/validation in a for laravel lighthouse.
In a schema.graphql file I have a number of queries where I'd like to apply exactly the same rule. This rule is based on applying a regex to input provided by the user.
In the snippet below, how can I reference a custom validation class to replace CUSTOM_REGEX_BASED_RULE
QueryName(
id: [ID] @in
name: String @where(operator: "like") @rules(apply: [“CUSTOM_REGEX_BASED_RULE”])
): [Amodel!] @all
There is this question on stackoverflow which references the validator class but I'm struggling to see how to apply a newly created validator to a rule for a query.
I'm using Laravel 9 and the latest version of lighthouse.