bobbyt
06/10/2017, 12:50 PMsubscription userPosts {
User(
filter: {
updatedFields_contains: "username"
}
) {
mutation
node {
posts {
createdBy {
name
}
description
status
}
}
updatedFields
}
}
But when I switch updatedFields_contains
to a field that references another type (i.e. "posts" field in User type references many Posts), any updates to my Post data will not be intercepted by the subscription:
subscription userPosts {
User(
filter: {
updatedFields_contains: "posts" <----- nothing happens when Post data is updated
}
) {
mutation
node {
posts {
createdBy {
name
}
description
status
}
}
updatedFields
}
}
Here is my User schema:
type User implements Node {
auth0UserId: String @isUnique
comments: [Comment!]! @relation(name: "CommentsByUser")
createdAt: DateTime!
id: ID! @isUnique
name: String!
posts: [Post!]! @relation(name: "PostsByUser")
updatedAt: DateTime!
username: String
}
Is there another way to use updatedFields_contains
with a field that references another type? Thanks!agartha
06/10/2017, 1:00 PMagartha
06/10/2017, 1:06 PMbobbyt
06/10/2017, 1:14 PMagartha
06/10/2017, 1:14 PMagartha
06/10/2017, 1:15 PMagartha
06/10/2017, 1:15 PMagartha
06/10/2017, 1:16 PMbobbyt
06/10/2017, 1:17 PMsubscription allUserPosts {
Post (
filter: {
mutation_in: [CREATED, UPDATED, DELETED]
}
) {
mutation
node {
description
}
}
}
bobbyt
06/10/2017, 1:18 PMagartha
06/10/2017, 1:18 PMagartha
06/10/2017, 1:19 PMbobbyt
06/10/2017, 1:19 PMagartha
06/10/2017, 1:19 PMagartha
06/10/2017, 1:20 PMagartha
06/10/2017, 1:22 PMagartha
06/10/2017, 1:22 PMbobbyt
06/10/2017, 1:24 PMagartha
06/10/2017, 1:25 PMagartha
06/10/2017, 1:45 PMagartha
06/10/2017, 1:45 PMbobbyt
06/10/2017, 1:59 PM