import { GraphQLRequestEnvelope , Logger , GraphQLRequestEnvelopeError } from '@boostercloud/framework-types' ; import { Context } from '@azure/functions' ; export async function rawGraphQLRequestToEnvelope ( context , logger ) { logger . debug ( 'Received GraphQL request: ' , context . req ) ; const requestID = context . executionContext . invocationId ; const connectionID = undefined ; const eventType = 'MESSAGE' ; try { let graphQLValue = undefined ; if ( context . req ) { graphQLValue = context . req . body ; } return { requestID , eventType , token : context . req ?. headers ?. authorization , value : graphQLValue , } ; } catch ( e ) { return { error : e , requestID , connectionID , eventType , } ; } }