Jose Miguel Gallas Olmedo There are two things stored in the database to make a subscription work. The first one is a subscription object which looks something like this:
{ |
type: 'Subscription', |
field: 'memeAdded', |
GraphQLSchemaId: 1, |
topic: 'memeCreated', |
filter: JSON.stringify({ |
match: ['$payload.memeAdded.photourl', 'https://.*'] |
}), |
createdAt: time, |
updatedAt: time |
}
|
And then a resolver has to hook up to that particular subscription:
{ |
... |
publish: "memeCreated" |
}
|
Right now topics and filters are not being implemented in the UI but they do exist in the server. I suggest you take a look at the lengthy description in the original subscriptions PR: https://github.com/aerogear/data-sync-server/pull/32 |