src/index.js
/**
 * Construct a generic GraphQL operation message.
 * @constructor
 * @param {string} type - Message type
 * @throws {TypeError} Throws a type error if the provided message type is invalid or empty.
 * @returns {OperationMessage}
*/
Construct a generic GraphQL operation message.
@constructor
@param {string} type - Message type
@throws {TypeError} Throws a type error if the provided message type is invalid or empty.
Construct a generic GraphQL operation message . @constructor @param { string } type - Message type @throws { TypeError } Throws a type error if the provided message type is invalid or empty .
function OperationMessage(type) {
    if (typeof(type) !== "string" || type === "") {
        throw TypeError("Invalid message type");
    }
    Object.defineProperty(this, "type", {
        enumerable: true,
        configurable: false,
        value: type
    });
}
function OperationMessage ( type ) { if ( typeof ( type ) !== "string" || type === "" ) { throw TypeError ( "Invalid message type" ) ; } Object . defineProperty ( this , "type" , { enumerable : true , configurable : false , value : type } ) ; }
Construct a generic GraphQL operation message.
Construct a generic GraphQL operation message .