NSWSESMembers / availability-poc

WIP proof of concept availability app
MIT License
10 stars 4 forks source link

Server Subscriptions (Event, EventResponse, Message) #517

Closed OSPFNeighbour closed 6 years ago

OSPFNeighbour commented 6 years ago

Server side code to allow web socket graphql subscriptions.

subscription {
eventResponse(eventId:3) {
  locationTime
  locationLatitude
  locationLongitude
  detail
  status
}
}

Change your status on event number 3 and you get pushed this

{
  "eventResponse": {
    "locationTime": 1529130510,
    "locationLatitude": -33.8323275,
    "locationLongitude": 151.0063851,
    "detail": null,
    "status": "unavailable"
  }
}

JWT Auth is implemented and seems to work.

Caveats:

codecov[bot] commented 6 years ago

Codecov Report

Merging #517 into master will decrease coverage by 0.75%. The diff coverage is 2.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #517      +/-   ##
==========================================
- Coverage   28.61%   27.85%   -0.76%     
==========================================
  Files         174      175       +1     
  Lines        2817     2897      +80     
  Branches      414      421       +7     
==========================================
+ Hits          806      807       +1     
- Misses       1700     1772      +72     
- Partials      311      318       +7
Flag Coverage Δ
#integration 0% <0%> (ø) :arrow_up:
#unittests 28.4% <2.08%> (-0.76%) :arrow_down:
Impacted Files Coverage Δ
server/src/schema.js 75% <ø> (ø) :arrow_up:
server/src/resolvers.js 1.58% <0%> (-0.08%) :arrow_down:
server/src/subscriptions.js 0% <0%> (ø)
server/src/main.js 0% <0%> (ø) :arrow_up:
server/src/constants.js 100% <100%> (ø) :arrow_up:
server/src/logic.js 1.94% <2.08%> (-0.29%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update adb089e...da4d8b8. Read the comment docs.

OSPFNeighbour commented 6 years ago

Auth is not working correctly

OSPFNeighbour commented 6 years ago

I fixed auth :-) client side error in the end

OSPFNeighbour commented 6 years ago

rebase