Skip to content

Instantly share code, notes, and snippets.

@billmetangmo
Created July 7, 2021 21:52
Show Gist options
  • Select an option

  • Save billmetangmo/fbe722b3c50d47ea9258a1c3a616f5e4 to your computer and use it in GitHub Desktop.

Select an option

Save billmetangmo/fbe722b3c50d47ea9258a1c3a616f5e4 to your computer and use it in GitHub Desktop.
Test a subscription on a event graphql aws event app example
query getAllEvents {
listEvents{
items{
id
name
when
}
}
}
mutation add {
createEvent(
name:"My first GraphQL event"
where:"Day 1"
when:"Friday night"
description:"Catching up with friends"
){
id
name
where
when
description
}
}
subscription commentOnEvents {
subscribeToEventComments(eventId: "c99e01c4-7da1-4757-925a-722edb0d02b4"){
content
commentId
}
}
mutation commentEvent {
commentOnEvent(
eventId:"c99e01c4-7da1-4757-925a-722edb0d02b4",
content: "je t'aime pas moi",
createdAt: "19/01/2020"
) {
eventId
content
commentId
}
}
query getAllEvents {
listEvents{
items{
id
name
comments {
items{
content
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment