notrab
05/10/2017, 6:29 PMEvent that has many Comment types. I’m trying to create a subscription for new comments. How would I do this?
subscription {
Event(filter:{
mutation_in: [CREATED],
}) {
node {
comments {
id
message
createdAt
}
}
}
}
Is as far as I got, I couldn’t figure out the way to set the eventIdnotrab
05/10/2017, 6:32 PMnode:{
id:"$eventId"
}
Do the trick? Am I missing something?nilan
05/10/2017, 7:09 PMeventId is $eventIdnilan
05/10/2017, 7:10 PMcreateComment(text: "" eventId: "event-id")nilan
05/10/2017, 7:10 PMnotrab
05/10/2017, 7:14 PMnotrab
05/10/2017, 7:14 PMsubscription {
Comment(filter:{
mutation_in: [CREATED],
eventId:$eventId
}){
node {
id
message
createdAt
}
}
}
Like this?nilan
05/10/2017, 7:15 PMsubscription {
Comment(filter:{
mutation_in: [CREATED],
node: {
eventId:$eventId
}
}){
node {
id
message
createdAt
}
}
}nilan
05/10/2017, 7:15 PMnotrab
05/10/2017, 7:17 PMnotrab
05/10/2017, 7:18 PMnilan
05/10/2017, 7:18 PMnotrab
05/10/2017, 7:18 PMnotrab
05/10/2017, 7:18 PM"message": "Argument 'filter' expected type 'CommentSubscriptionFilter' but got: {mutation_in: [CREATED], node: {eventId: \"cj2j9wmph9d080196fc20wa4c\"}}. Reason: [in field 'node'] Unknown field 'eventId' is not defined in the input type 'CommentSubscriptionFilterNode'. (line 5, column 7):\n eventId:\"cj2j9wmph9d080196fc20wa4c\"\n ^ (line 2, column 18):\n Comment(filter:{\n ^\n (line 5, column 7):\n eventId:\"cj2j9wmph9d080196fc20wa4c\"\n ^"notrab
05/10/2017, 7:19 PMeventId unknownnotrab
05/10/2017, 7:19 PMtype Comment implements Node {
createdAt: DateTime!
event: Event @relation(name: "EventOnComment")
id: ID! @isUnique
message: String
updatedAt: DateTime!
user: User @relation(name: "CommentOnUser")
}nilan
05/10/2017, 7:19 PMComment called that connects to the `Event `type?nilan
05/10/2017, 7:19 PMnilan
05/10/2017, 7:19 PMnotrab
05/10/2017, 7:19 PMnilan
05/10/2017, 7:19 PMsubscription {
Comment(filter:{
mutation_in: [CREATED],
node: {
event: {
id: $eventId
}
}
}){
node {
id
message
createdAt
}
}
}notrab
05/10/2017, 7:20 PMnilan
05/10/2017, 7:20 PMevent wrappernotrab
05/10/2017, 7:20 PM