import { GraphQLRequestEnvelope , GraphQLRequestEnvelopeError , Logger , UUID } from '@boostercloud/framework-types' ; import * as express from 'express' ; export async function rawGraphQLRequestToEnvelope ( request , logger ) { logger . debug ( 'Received GraphQL request: \n- Headers: ' , request . headers , '\n- Body: ' , request . body ) ; const requestID = UUID . generate ( ) ; const eventType = 'MESSAGE' ; const connectionID = undefined ; try { return { requestID , eventType , connectionID , token : request . headers . authorization , value : request . body , } ; } catch ( e ) { return { error : e , requestID , connectionID , eventType , } ; } }