Created
July 7, 2021 21:52
-
-
Save billmetangmo/fbe722b3c50d47ea9258a1c3a616f5e4 to your computer and use it in GitHub Desktop.
Test a subscription on a event graphql aws event app example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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