This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
Custom Events #589
Comments
This would also require a change to the subscription filter, because this is not a 1-on-1 match with I would suggest the following convenience methods on
Maybe even:
|
sorenbs
added
component/framework/subscription
rfc/0-needs-spec
and removed
component/core
labels
Oct 9, 2017
This issue has been moved to graphcool/graphcool-framework. |
This was referenced Dec 22, 2022
This was referenced Dec 23, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently the subscriptions API is automatically generated from the model types in a project.
This feature request introduces the ability to extend the subscription API with custom events.
Defining Custom events
A custom event can be added to the
types.graphql
file like this:Publishing Custom events
Custom events can be published using graphcool-lib. When publishing an event you must include the type name and a json object containing all required data.
In the example above one of the fields is a Graphcool model type. In this case, instead of providing the entire
User
node, the id of an existingUser
must be provided:Subscribing to Custom events
Custom events can be subscribed to with a normal subscription query from both frontend and backend.
Custom events should implement the normal permission system.
Custom events should support normal filters including relations
The text was updated successfully, but these errors were encountered: