Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subscriptions in Apollo Server v4

This example demonstrates a basic subscription operation in Apollo Server. See the docs on subscriptions

The example server exposes one subscription (progressData) that returns an object:

{
	status: String;
	propId: String;
	ticker: String;
}

After you start up this server, you can test out running a subscription with the Apollo Studio Explorer by following the link from http://localhost:4000/graphql to the Apollo Sandbox. You might need to edit the Apollo Sandbox connection settings to select the graphql-ws subscriptions implementation. You'll see the subscription's payload property ticker value update every second.

subscription progressData($propId: ID!, $deviceId: String!) {
	progressData(propId: $propId, deviceId: $deviceId) {
		status
		propId
		ticker
	}
}

Run locally

npm install
npm run dev

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages