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!busk
06/10/2017, 2:19 PMgildas
06/10/2017, 5:01 PMWhoops. Looks like an internal server error. Please contact us in Slack (https://slack.graph.cool) and send us your Request ID: cj3rj2nas4gvq0177qex879mp
nilan
06/10/2017, 6:12 PMagartha
06/10/2017, 8:07 PMnilan
06/10/2017, 8:15 PMdk0r
06/10/2017, 10:26 PMrelations
correctly. In the following example, is it the case that every Team
requires an associated User
, but not every User
requires an associated Team
? http://i.imgur.com/tE6uizo.pngβΎ
dk0r
06/10/2017, 10:29 PMmany-to-one relation
shown above, that each Team
can be related to multiple users but each User
can only be related to one Team
?yus
06/10/2017, 10:29 PMjpdesigndev
06/11/2017, 1:34 AMUser -> Provider | Customer
?dk0r
06/11/2017, 1:46 AMajmakhl
06/11/2017, 1:48 AMeliezedeck
06/11/2017, 1:49 AMsubscriptions-transport-ws@0.7.1
this morning. While there is no longer a 400 error message, the server is sending a message of type βkeepaliveβ, which is not exactly what the client expects. Instead, it expects βkaβ for KEEP_ALIVE messages type. Because of this, the next error I see in the console is:
Uncaught Error: Invalid message type!
at SubscriptionClient.processReceivedData (client.js:387)
at WebSocket.client.onmessage (client.js:329)
fourcolors
06/11/2017, 5:04 AMfourcolors
06/11/2017, 5:06 AMfourcolors
06/11/2017, 5:06 AMfourcolors
06/11/2017, 5:49 AMsorenbs
bartamon
06/11/2017, 1:39 PMeliezedeck
06/11/2017, 1:45 PMdk0r
06/11/2017, 2:02 PMhttp://i.imgur.com/bunafYv.pngβΎ
agartha
06/11/2017, 2:48 PMnilan
06/11/2017, 2:49 PMnilan
06/11/2017, 2:53 PMagartha
06/11/2017, 4:34 PMsocialgraph
06/11/2017, 4:37 PMpascalo
06/11/2017, 7:45 PMpascalo
06/11/2017, 7:46 PM${GRAPHQL_ENDPOINT}
, {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization': Bearer ${PAT}
},
body: '{"query":"mutation { createPost( imageUrl: \"https://facebook.github.io/react/img/logo_og.png\" description: \"my-great-meteor\") {id }}"}',
})
.then((response) => {
if (response.status > 400) {
throw new Error("Bad response from server")
} else {
return response.json()
}
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});dtuite
06/11/2017, 10:04 PMdrk
06/11/2017, 10:35 PM