This repository illustrates how to implement a GraphQL subscription using Django signals in a Django application, using the graphene-django and graphene-luna libraries.
In GraphQL, a subscription allows clients to receive real-time updates on specific events.
https://subscription.meetsum.net/graphql
subscription subscribeToNewManga {
newManga {
id
name
synopsis
author
createdDate
}
}
mutation addManga($name: String = "Bleach", $synopsis: String = "Synopsis", $author: String = "Tite Kubo") {
addManga(name: $name, synopsis: $synopsis, author: $author) {
success
message
manga {
id
name
synopsis
author
createdDate
}
}
}
query Mangas {
manga {
edges {
node {
id
name
synopsis
author
createdDate
}
}
}
}
To test on GraphiQL, open two browser windows: one to run the subscription, which will listen for newly added manga, and the other to run the add manga mutation.