src/index.js
/**
 * Construct a GraphQL communication initialization message.
 * @constructor
 * @augments OperationMessageFromClient
 * @param {object=} payload - Connection parameters
 * @throws {TypeError} Throws a type error if the provided payload is invalid.
 * @returns {InitMessage}
*/
Construct a GraphQL communication initialization message.
@constructor
@augments OperationMessageFromClient
@param {object=} payload - Connection parameters
@throws {TypeError} Throws a type error if the provided payload is invalid.
Construct a GraphQL communication initialization message . @constructor @augments OperationMessageFromClient @param { object = } payload - Connection parameters @throws { TypeError } Throws a type error if the provided payload is invalid .
function InitMessage(payload) {
    if (this instanceof InitMessage) {
        if (payload !== undefined && typeof(payload) !== "object") {
            throw TypeError("Invalid payload");
        }
        OperationMessageFromClient.call(this, "connection_init");
        Object.defineProperty(this, "payload", {
            enumerable: true,
            configurable: false,
            value: payload || {}
        });
    } else {
        return new InitMessage(payload);
    }
}
function InitMessage ( payload ) { if ( this instanceof InitMessage ) { if ( payload !== undefined && typeof ( payload ) !== "object" ) { throw TypeError ( "Invalid payload" ) ; } OperationMessageFromClient . call ( this , "connection_init" ) ; Object . defineProperty ( this , "payload" , { enumerable : true , configurable : false , value : payload || { } } ) ; } else { return new InitMessage ( payload ) ; } }
Construct a GraphQL communication initialization message.
Construct a GraphQL communication initialization message .