2 個答案
- 最新
- 最多得票
- 最多評論
0
I seem to have answered my own question.
AWS is expecting a query payload that does not follow the shape of the subscription-transport-ws library. Instead, it expects something like this.
{"id":"1","type":"start","payload":{"variables":{"sessionID":"659d86ae-ec0c-4170-9866-b436a981ce29"},"extensions":{"authorization":{"host":"fev5xxdscnesvifqf45rj3zsl4.appsync-api.us-east-2.amazonaws.com","x-amz-user-agent":"aws-amplify/2.0.1","x-api-key":"da2-jdwemepvzbeo5okdsfokyqdmtq"}},"operationName":"ParticipantJoined","query":"subscription ParticipantJoined($sessionID: ID!) {\n participantJoinedSession(id: $sessionID) {\n id\n name\n participants {\n name\n vote {\n points\n abstained\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","data":"{\"variables\":{\"sessionID\":\"659d86ae-ec0c-4170-9866-b436a981ce29\"},\"extensions\":{},\"operationName\":\"ParticipantJoined\",\"query\":\"subscription ParticipantJoined($sessionID: ID!) {n participantJoinedSession(id: $sessionID) {n idn namen participants {n namen vote {n pointsn abstainedn __typenamen }n __typenamen }n __typenamen }n}n\"}"}}
Furthermore, app sync returns a start_ack message type which is not part of subscription-transport-ws' lifecycle events.
已回答 4 年前
0
To get AppSync Subscriptions working with subscription-transport-ws, you need to follow the instructions in this GitHub issue: https://github.com/apollographql/apollo-feature-requests/issues/224
已回答 4 年前
相關內容
- 已提問 9 個月前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前