apollo-server icon indicating copy to clipboard operation
apollo-server copied to clipboard

Bun integration

Open RajaARK99 opened this issue 2 years ago • 11 comments

Support bun in Apollo server.

RajaARK99 avatar Sep 23 '23 01:09 RajaARK99

Can you expand? What is currently unsupported? Is this issue related?

trevor-scheer avatar Sep 25 '23 18:09 trevor-scheer

Use bun as a run time not using node.

Can you expand? What is currently unsupported? Is this issue related?

RajaARK99 avatar Sep 26 '23 16:09 RajaARK99

I think the issue I linked is related then. It requires Apollo Server to stop using Node APIs. Is that what's preventing AS from running in Bun or is there anything else?

A PR to fix https://github.com/apollographql/apollo-server/issues/7369 would be welcome. I won't be able to prioritize this work any time soon.

trevor-scheer avatar Sep 29 '23 18:09 trevor-scheer

Here's what I ran into when trying to get Apollo Server running on Bun:

  • https://github.com/oven-sh/bun/issues/4947

michaelbromley avatar Oct 24 '23 18:10 michaelbromley

Query and Mutation work for me in bun v1.0.8, but subscription doesn't work.

  • https://github.com/oven-sh/bun/issues/6905
  • https://github.com/apollographql/apollo-server/issues/7776 Which NodeJS API does apollo server use that bun doesn't implmenet?

HuakunShen avatar Nov 05 '23 03:11 HuakunShen

As mentioned in the comment above and in the duplicate issue here, it would be nice to consider subscriptions as well when resolving this issue (though all subscriptions related work belongs to separate projects, so that would likely be a separate PR to another project).

trevor-scheer avatar Nov 08 '23 18:11 trevor-scheer

Same issue as reported by @michaelbromley. @HuakunShen how did you get queries to work?

oliveredsberger avatar Nov 24 '23 20:11 oliveredsberger

@oliveredsberger It works out of the box. Use this example https://github.com/apollographql/docs-examples/tree/main/apollo-server/v4/getting-started

bun src/index.ts

I tried running TypeScript directly with bun, or run the compiled JS with bun. Both work.

HuakunShen avatar Nov 25 '23 04:11 HuakunShen

Hello, I've just made this:

https://github.com/ChrisEnglert/apollo-server-integration-bun

Allows using ApolloServer with Bun.serve({...}) API

maybe you'd like to consider this for @as-integrations ?

ChrisEnglert avatar Dec 17 '23 16:12 ChrisEnglert

@ChrisEnglert that would be great! Would you like it to publish under the @as-integrations npm scope as well? Go ahead and transfer the repo to the apollo-server-integrations org if that's still something you'd like to do and we can go from there.

trevor-scheer avatar Dec 18 '23 19:12 trevor-scheer

@trevor-scheer yes, sure. I just need an invite I guess ("You don’t have the permission to create public repositories on apollo-server-integrations")

ChrisEnglert avatar Dec 18 '23 21:12 ChrisEnglert