nuwave / lighthouse

A framework for serving GraphQL from Laravel
https://lighthouse-php.com
MIT License
3.36k stars 438 forks source link

Please add `@rules` multilingual site support feature #1773

Open Rasool-deldar opened 3 years ago

Rasool-deldar commented 3 years ago

What problem does this feature proposal attempt to solve?

To support multilingual sites

image As you can see in the image, we use trans to return a specific type of return data to the same language

Which possible solutions should be considered?

Adding the trans feature to @rules solves this problem, for example, translating a translation to rules when it was true

@rules(translation: true) # default false

spawnia commented 3 years ago

Have you considered https://lighthouse-php.com/master/security/validation.html#validator-classes? They support defining rules through arbitrary PHP code.