3 ms·
This is the reason why I want to support such a query for my GraphQL server: My goal is to allow users of my WordPress plugin (i.e. not just coders, but also n
by leoloso 6y ago
This is the reason why I want to support such a query for my GraphQL server:
My goal is to allow users of my WordPress plugin (i.e. not just coders, but also non-techies, such as bloggers) to configure how the GraphQL server will behave through a user interface, with no coding involved whatsoever.
That query to send email notifications is then a use case all by itself, and a demonstration of what these features can achieve:
Using embeddable fields, starting from a `Post`, the UI would enable users to compose the notification message using placeholders `{{ title }}`, `{{ content }}`, `{{ date }}`, etc. With the flat chain syntax it gets better, since they could retrieve data from other entities, such as `{{ author.email }}`, or even iterating down from `Root` doing `{{ root.me.email }}`. Then this string is injected into the directive `@sendEmail` (which would be provided by some WP plugin), and added to the schema through IFTTT rules, as I've described here: https://blog.logrocket.com/adding-directives-schema-code-first-graphql-servers/ https://blog.logrocket.com/adding-directives-schema-code-fir...
As a result, the user can install a WP plugin, add `@sendEmail` to the schema through configuration, and customize the email, without touching one line of code.