This repository was archived by the owner on Feb 9, 2023. It is now read-only.
v2.0.0
FEATURES
startServerAndCreateCloudflareHandlerwill return an request handler (GraphQLRequestHandler) instead of theResponse
BREAKING CHANGE:
Before:
const response = startServerAndCreateCloudflareHandler(server, {
cors: { // cors configuration },
context: async () => {
const cache = options.kvCache ? new KVCache() : server.cache;
const dataSources: ApolloDataSources = {
pokemonAPI: new PokemonAPI({ cache }),
};
return { dataSources };
}
});After:
const handleGraphQLRequest = startServerAndCreateCloudflareHandler(server, {
cors: options.cors,
context: async () => {
const cache = options.kvCache ? new KVCache() : server.cache;
const dataSources: ApolloDataSources = {
pokemonAPI: new PokemonAPI({ cache }),
};
return { dataSources };
}
});
const response = await handleGraphQLRequest(request);