Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom events and custom queries #66

Open
anasbarg opened this issue Nov 20, 2020 · 0 comments
Open

Custom events and custom queries #66

anasbarg opened this issue Nov 20, 2020 · 0 comments
Labels

Comments

@anasbarg
Copy link
Collaborator

Custom events and custom queries

Why

This will be a generic solution for developers to implement custom GraphQL operations, and custom events. Not "just" CRUD, though I believe that CRUD is enough for 99% of use cases.

Syntax

event <event_name> {
  on = <"REQUEST" | "STREAM" | "<model_name>.[<field_name>] <builtin_event>" | (imported_function: (dispatch: Dispatcher) => Unit)> # `imported_function` is a function that setups some stream and listens to it by dispatching events using `dispatcher`. Overtime we can implement some builtin functions for popular stuff like Reddis, RabbitMQ, etc. 
  [parser  = <imported_function: Request => Boolean>] # This is only required when `on == "REQUEST"`
  [request_handler = <imported_function: Request => Response>]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant