You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hooking in on DataObject->write() rather than mutations in order to capture database modifications which aren't triggered by GraphQL. This also includes form submissions, so pretty much every CMS-facing modification
I think the "local store" for subscription queries should be in the SilverStripe database. The server can't predict which subscription queries it will receive, but in practice there'll be a pretty limited set (predetermined in the JS build files). So there's no point expiring/clearing these queries
For implementations other than pusher.com (e.g. a Ratchet web server hosted in parallel with a SilverStripe Apache), the
Channels don't need to be registered explicitly in pusher.com, clients can subscribe to arbitrary names
Long polling in Apollo would be a lot simpler to implement, but doesn't scale well: Every client will be interested in handful of GraphQL queries in the current view, and cause additional load on the server for every logged-in author. On the positive note, polling can be more granular in the data it needs to query since it knows e.g. the exact pagination state - while subscriptions will need to send every change of a certain type down to every subscriber.
Subscription updates of the local Apollo/GraphQL store have the same issues as described in Update GraphQL models after form submission: Individual views need to be in charge or inspecting a payload, and determining how it influences the GraphQL state they maintain through their own gql queries (e.g. adding a record to a filtered list)
Setup
ApolloClient.subscribe()
methodSubscribing to Changes
subscription
query when viewing a UI depending on these updatesSending Updates
onAfterWrite()
hook firesParentID
in the payload)Unsubscribing
ApolloClient.unsubscribe()
Authentication
TODO
Use Cases
Example Subscriptions
Notes
DataObject->write()
rather than mutations in order to capture database modifications which aren't triggered by GraphQL. This also includes form submissions, so pretty much every CMS-facing modificationgql
queries (e.g. adding a record to a filtered list)References
The text was updated successfully, but these errors were encountered: