Experimental transport implmentation for GraphQL dotnet server 5.0.2+, with graphql-sse as client.
- Make sure dotnet 6 and nodejs are installed
- Inside
GraphQL.Server.Transports.ServerSentEvents.Samples/ClientApp
, runnpm install
,npm run build
- Inside
GraphQL.Server.Transports.ServerSentEvents.Samples
, rundotnet run
- Visit http://loccalhost:5000/index.html, click
subscribe
button - With some http client like
postman
, send a GraphQL mutation like
// Query
mutation AddMessage($message: MessageInputType!) {
addMessage(message: $message) {
from {
id
displayName
}
content
}
}
// Variables
{
"message": {
"content": "Message",
"fromId": "1"
}
}
Note: The subscription query is
subscription MessageAdded {
messageAdded {
from { id displayName }
content
}
}
- Fix single connection
- Unit tests
- Github actions
- Test with more cases
- Beautify example
- Publish to Nuget
MIT