gsox
framework for streaming data to browser and mobile clients using grapqhl subscriptions, websockets, and webhook
installation
npx gsox
schema
describe your data types
@ @ id:number @ type:string @ ... const inject = Notification MessageType
client
consume/subscribe to one or more types
react
const client = <StreamProvider client=client> <StreamConsumer types=Notification> { ifloading return <Loading /> ifdata return <DataView /> } </StreamConsumer></StreamProvider>
observable
const client = client
server
inject data types and apply express middleware
const app = const server = server
endpoints
http://host:port/webhook
- accepts shape of your schema
ws://host:port/graphql
- publishes webhook body to client subscribers
options
host: "localhost" port: 3000 routes: graphql: "/graphql" webhook: "/webhook"