afgh
03/01/2017, 12:11 PMtim2
03/01/2017, 1:18 PMmutation
on the level of the filter
. People who are used to the AND
and OR
syntax know, which powerful filters you can write with that.
Scaphold supports basic scalar filters in their subscriptions.
However, as soon as you’re building a real big application, relational filters on subscriptions are a necessity.
Imagine you want to build Facebook and only get notified when a friend creates a Post, but not when someone else of the hundred millions of users post something.
As far as I can see, in Scaphold you currently can’t define a filter for that.
So before we released the Subscriptions it was very important to us to support that use case.
Graphcool not only supports scalar and relational filters in the subscription, but you can also combine the normal filters with subscription specific filters like mutation_in
or updatedFields_contains
.
That means in a chat you can say I am interested in all related messages and if the text
of a message has been updated.
This is how you would express it with Graphcools API:
Message(filter: {
node: {
room: {
name: "my chatroom"
}
}
mutation_in: [CREATED,UPDATED]
updatedFields_contains: "text"
}) {
mutation
updatedFields
node {
id
text
author {
id
name
}
}
previousValues {
text
}
}
There is much more to say, especially when it comes to our backend implementation, but I hope this could already give you an overview about the two implementations. In the next weeks we will release a blog article discussing our backend implementation of the GraphQL Subscriptions.daver182
03/01/2017, 3:42 PMartyom
03/01/2017, 4:16 PMoliver
03/01/2017, 4:25 PMmartin
03/01/2017, 6:19 PMartyom
03/01/2017, 7:41 PMmathieusylvain
03/01/2017, 7:45 PMdavidyoung
03/01/2017, 8:06 PMjarvis
03/01/2017, 8:23 PMjarvis
03/01/2017, 8:25 PMsorenbs
martin
03/01/2017, 10:14 PMtheraccoun
03/01/2017, 10:25 PMtheraccoun
03/01/2017, 10:25 PMtheraccoun
03/01/2017, 10:25 PMtheraccoun
03/01/2017, 10:25 PMdavidyoung
03/02/2017, 12:06 AMsashko
03/02/2017, 1:40 AMwatchQuery
instead of using the graphql
containersashko
03/02/2017, 1:40 AMsubscribeToMore
sashko
03/02/2017, 1:40 AMclient.subscribe
directlytheraccoun
03/02/2017, 1:52 AMtheraccoun
03/02/2017, 1:53 AMsashko
03/02/2017, 1:53 AMtheraccoun
03/02/2017, 1:54 AMtheraccoun
03/02/2017, 1:54 AMsashko
03/02/2017, 1:55 AMsashko
03/02/2017, 1:55 AMsashko
03/02/2017, 1:55 AMtheraccoun
03/02/2017, 1:55 AM