Closed rrifafauzikomara closed 1 year ago
You server is returning Bad Request
and the library can not parse it.
Not a library problem if you are not constructing a proper request.
Correct @robertoestivill
In any case, I am closing this due to the lack of minimal reproducible example
Hi @robertoestivill @vincenzopalazzo do u have any example of subs implementation? seems ur documentation not proper yet. Open an issue for that one as well here: https://github.com/zino-hofmann/graphql-flutter/issues/1349
Updated the example as well with postman screenshot
Updated.
Now I saw these on the log.
flutter: Initialising connection
flutter: Disconnected from websocket.
flutter: Initialising connection
flutter: Disconnected from websocket.
flutter: Initialising connection
Mean successfully connecting to subscription/websocket?
you may are setting the wrong ws protocol?
you may are setting the wrong ws protocol?
so this one (https://github.com/zino-hofmann/graphql-flutter/issues/1350#issuecomment-1640470400) still not connected to subscription/websocket?
the ws has different protocols
the ws has different protocols
hmm what u mean diff protocols? or do u have any idea what code should i check?
Coz basically, i just added this code.
final AuthLink authLink =
AuthLink(getToken: () => 'Bearer $currentToken');
final Link linkSplitted = authLink.split(
(request) => request.isSubscription,
webSocketLink,
httpLink,
);
and the result is this: https://github.com/zino-hofmann/graphql-flutter/issues/1350#issuecomment-1640470400
If I remove that like this one.
final Link linkSplitted = httpLink.split(
(request) => request.isSubscription,
webSocketLink,
httpLink,
);
I will got an error like this one: https://github.com/zino-hofmann/graphql-flutter/issues/1350#issue-1770000167
this https://github.com/zino-hofmann/graphql-flutter/pull/1206 should have a basic configuration of the ws, also please check the documentation and also research about grahql ws protocols
let me check ur example
: https://github.com/zino-hofmann/graphql-flutter/tree/main/examples/starwars
idk why prev i dont see it.
Hi, @vincenzopalazzo @robertoestivill have a question.
In Postman, if I don't send a Message
by clicked the Send
button after successfully connected to the wss. I also can't get the data. The result is the same as this one (https://github.com/zino-hofmann/graphql-flutter/issues/1350#issuecomment-1640470400), only successfully connected or disconnected.
Screenshot Postman:
Message
from Postman:
{
"id": "{{$randomUUID}}",
"payload": {
"data": "{\"query\":\"subscription updateCheckout { onUpdateCheckout(userId: \\\"{{userId}}\\\") { userId createdAt amount checkoutId maxAllowedAmount maxAvailableAmount message state trancheId }}\"}",
"extensions": {
"authorization": {
"Authorization": "{{cognitoIdToken}}",
"host": "{{apiHost}}"
}
}
},
"type": "start"
}
Schema
from AWS.
subscription MySubscription {
onUpdateCheckout(userId: $userId) {
createdAt
checkoutId
maxAllowedAmount
maxAvailableAmount
message
state
trancheId
}
}
So my question is, how can I send a Message
from the app side using this package?
Postman.
example code of subs
logs