Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use MongoDB on Apollo Server without the use of anything related to Express? #1781

Closed
bchehraz opened this issue Oct 8, 2018 · 3 comments

Comments

@bchehraz
Copy link

bchehraz commented Oct 8, 2018

Hello,

This might be a super general and vague question to ask- I just want to know if it's possible to set up Apollo Server/GraphQL & also run MongoDB (using Mongoose) in the same project. I'm new to all this tech.

I was under the impression that you'd be able to run Apollo Server and MongoDB without Express, but every tutorial I find online is using both Apollo Server AND Express. I was under the impression that Express and Apollo did the same job and that there was no reason to have both...

Thank you

@selipso
Copy link

selipso commented Oct 17, 2018

I don't think this is how Apollo Server works. Although Apollo adds a GraphQL wrapper around a node server to handle GraphQL queries, you still need a node server to wrap around underneath (provided by Express, Koa, and other frameworks that Apollo is compatible with).

If you are looking for a more batteries-included solution, you may want to look at Prisma, which will soon release the beta version of its MongoDB connector that you can follow along its progress here. Prisma uses Apollo Server underneath the hood and sets up a graphql-express server for you with nice default values.

@eberhara
Copy link
Contributor

As @selipso said, apollo-server is a graphql wrapper around a nodejs server, which is commonly an express server.
The choices you make behind the graphql wrapper is really up to you. So yes, it is definitely possible to use mondogb along with apollo. However, you still need a nodejs server.

@jasonpaulos jasonpaulos added the 🚧👷‍♀️👷‍♂️🚧 in triage Issue currently being triaged label Jul 8, 2019
@jasonpaulos
Copy link

Hi everyone, I'm going to close this since this doesn't appear to be a bug with Apollo Server, but rather a question about how to use it or one of its components.

Rather than asking it here in GitHub Issues — where efforts are focused on fixing bugs and adding new features — I recommend directing further questions to the Apollo Server channel within the Apollo community on Spectrum.chat where there are community members who might be able to relate to a similar problem, or might be able to help you out more interactively. Thanks for your understanding!

@abernix abernix removed 🚧👷‍♀️👷‍♂️🚧 in triage Issue currently being triaged labels Jul 9, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants