- Status: proposed
- Date: 2022-10-12
Technical Story:
How to stitch multiple graphql/rest/grpc services into one graphql schema?
const connectionCheckerMachine = Machine({ | |
id: 'light', | |
initial: 'green', | |
states: { | |
green: { | |
on: { | |
TIMER: 'yellow', | |
WHATEVER: 'red' | |
} |
const connectionCheckerMachine = Machine({ | |
id: 'networkConnection', | |
initial: 'offline', | |
states: { | |
offline: { | |
after: { | |
3000: 'connecting' |
const checkWifiCredentials = (context) => { | |
const { wifi: { ssid, password, encryptionType, hidden } } = context; | |
return !!ssid && !!password && !!encryptionType && hidden !== undefined; | |
}; | |
const checkAccessToken = (context) => { | |
return !!context.accessToken; | |
}; | |
const checkCredentials = (context, event, { cond }) => { | |
return ((checkWifiCredentials(context) && checkAccessToken(context)) === | |
!cond.negate); |