generated from apollographql/typescript-repo-template
    
        
        - 
                Notifications
    
You must be signed in to change notification settings  - Fork 14
 
Open
Description
Passing an HttpRequest to the handler should not result in the request getting mangled.
Behaviour before 0.2.2: context is created and returned.
Behaviour on 0.2.2: Context creation failed: Request is not an instance of HttpRequest
import { ApolloServer } from '@apollo/server';
import { v4 } from '@as-integrations/azure-functions';
import { app, HttpRequest } from '@azure/functions';
const server = new ApolloServer({
  // config
});
const createContext = async (args: v4.AzureFunctionsContextFunctionArgument) => {
  if (args.req instanceof HttpRequest) {
    return {};
  }
  throw new Error('Request is not an instance of HttpRequest');
}
const handler = v4.startServerAndCreateHandler(server, {
  context: createContext,
});
app.http('graphql', {
  authLevel: 'anonymous',
  methods: ['GET', 'POST', 'OPTIONS'],
  handler,
});This seems to be because of this change.
Metadata
Metadata
Assignees
Labels
No labels