Closed denisyilmaz closed 1 year ago
I've pushed an implementation of this functionality to 4.x.dev
with the intention of releasing it in 4.3.0
.
For now, I went with a single @wordsmith directive, which supports any function that doesn't require arguments.
(The way Craft has implemented custom GQL Directives requires the apply() logic to be in a static context; Unfortunately, that prohibits my idea for generating/registering directives dynamically, at least for now.)
This PR adds all directives which return a
string
orboolean
without the need to add any arguments. Arguments for directives are currently not supported as well as functions which return arrays/objects (likeurlParse()
orparseName()
).List of directives is based on
WordsmithService::getInstance()->getMethodList()
.references #46