Relevant, but not duplicate: #472
Hello!
I'm working on an implementation (not in JavaScript) of the spec defined in PROTOCOL.md, and have realized that all of the operation names defined in the spec are inconsistent with what is used in subscriptions-transport-ws and graphiql-subscriptions-fetcher.
For example, connection initialization, according to the spec uses operation names such as GQL_CONNECTION_INIT, GQL_CONNECTION_ACK, etc. In reality, though, the client actually sends an init message to the server. A GQL_CONNECTION_ACK response from the server results in a client side error - "invalid message type!"
A quick look at the minified file shows the following:
var SUBSCRIPTION_FAIL = 'subscription_fail';
exports.SUBSCRIPTION_FAIL = SUBSCRIPTION_FAIL;
var SUBSCRIPTION_END = 'subscription_end';
exports.SUBSCRIPTION_END = SUBSCRIPTION_END;
var SUBSCRIPTION_DATA = 'subscription_data';
exports.SUBSCRIPTION_DATA = SUBSCRIPTION_DATA;
var SUBSCRIPTION_START = 'subscription_start';
exports.SUBSCRIPTION_START = SUBSCRIPTION_START;
var SUBSCRIPTION_SUCCESS = 'subscription_success';
exports.SUBSCRIPTION_SUCCESS = SUBSCRIPTION_SUCCESS;
var KEEPALIVE = 'keepalive';
exports.KEEPALIVE = KEEPALIVE;
var INIT = 'init';
exports.INIT = INIT;
var INIT_SUCCESS = 'init_success';
exports.INIT_SUCCESS = INIT_SUCCESS;
var INIT_FAIL = 'init_fail';
exports.INIT_FAIL = INIT_FAIL;
None of the above names are defined in the spec.
I acknowledge that the spec was last updated two years ago... But at the same time, it was last updated two years ago, while the repo itself has seen updates as recently as yesterday.
Is there any way that the spec cannot be updated to accurately reflect the format that clients accept?
I'm new to Apollo, so I'm not 100% sure I could complete a PR alone, but I'd be willing to help out with fixing this. The current state, though, is not of much of help to anyone trying to implement the spec.
EDIT 1: In addition, the id field in OperationMessage is defined as a string, but in reality is a number.
EDIT 2: The subscription_start RPC does not adhere to the OperationMessage schema. Instead of query and variables being in the payload, they are sent at the top level.
EDIT 3: Keep alive does not work as described in the spec - GraphiQL will still time out, even when it is used.
EDIT 4: The spec does not indicate that the graphql-subscriptions WebSocket protocol is required.
I've accepted that this repository is dead - the entirety of the last 7 pages of pull requests are created by a bot, and the last contributor response I can see on an issue is from 2018.
Most helpful comment
I've accepted that this repository is dead - the entirety of the last 7 pages of pull requests are created by a bot, and the last contributor response I can see on an issue is from 2018.