src/index.js
/**
 * Construct a GraphQL operation termination message.
 * @constructor
 * @augments OperationMessageFromClient
 * @param {string} id - Operation identifier
 * @throws {TypeError} Throws a type error if the provided operation identifier is invalid or empty.
 * @returns {StopMessage}
*/
Construct a GraphQL operation termination message.
@constructor
@augments OperationMessageFromClient
@param {string} id - Operation identifier
@throws {TypeError} Throws a type error if the provided operation identifier is invalid or empty.
Construct a GraphQL operation termination message . @constructor @augments OperationMessageFromClient @param { string } id - Operation identifier @throws { TypeError } Throws a type error if the provided operation identifier is invalid or empty .
function StopMessage(id) {
    if (this instanceof StopMessage) {
        if (typeof(id) !== "string" || id === "") {
            throw TypeError("Invalid operation identifier");
        }
        OperationMessageFromClient.call(this, "stop");
        Object.defineProperty(this, "id", {
            enumerable: true,
            configurable: false,
            value: id
        });
    } else {
        return new StopMessage(id);
    }
}
function StopMessage ( id ) { if ( this instanceof StopMessage ) { if ( typeof ( id ) !== "string" || id === "" ) { throw TypeError ( "Invalid operation identifier" ) ; } OperationMessageFromClient . call ( this , "stop" ) ; Object . defineProperty ( this , "id" , { enumerable : true , configurable : false , value : id } ) ; } else { return new StopMessage ( id ) ; } }
Construct a GraphQL operation termination message.
Construct a GraphQL operation termination message .