Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Releases: kimyvgy/apollo-server-integration-cloudflare-workers

v2.0.1

09 Feb 02:38
8f9addb
Compare
Choose a tag to compare
  • This package is moved to @as-integrations/cloudlare-workers
  • Please migrate to use @as-integrations/cloudlare-workers instead

https://github.com/apollo-server-integrations/apollo-server-integration-cloudflare-workers

v2.0.0

20 Dec 03:39
Compare
Choose a tag to compare

FEATURES

  • startServerAndCreateCloudflareHandler will return an request handler (GraphQLRequestHandler) instead of the Response

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);