question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2] Any plans to export graphqlExpress as well from apollo-server-express

See original GitHub issue

applyMiddleware really helps to add the middleware existing app.

const server = new ApolloServer({
  // These will be defined for both new or existing servers
  typeDefs,
  resolvers,
});

server.applyMiddleware({ app }); // app is from an existing express app

However it would be really awesome, if the graphqlExpress is also exposed to users.

Any possible way to access graphqlExpress directly from ApolloServer or the apollo-server-express module?

This will really help anyone want to pass the middleware function to lets say a router module that would take of applying the middleware.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sbrichardsoncommented, Sep 26, 2018

Kind of a hack, but you can import it currently from here:

import { graphqlExpress } from 'apollo-server-express/dist/expressApollo'

I’m using it to extend ApolloServer with a custom async schema (example)

0reactions
abernixcommented, Oct 22, 2018

Thank you for your help triaging, @razor-x! Agree on consolidating, and definitely something we’re aware of. The workaround above can be utilized in a pinch, but we do intend to address this.

Let’s take any further discussion to #1308. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to Apollo Server 4 - Apollo GraphQL Docs
If you are using Apollo Server 2, you must first migrate to Apollo Server 3 before following this guide. We recommend that all...
Read more >
apollo-server-express | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Integrate TypeScript with GraphQL using TypeGraphQL
Build an API to integrate TypeScript with GraphQL using the TypeGraphQL library, which simplifies creating GraphQL APIs in Node.js.
Read more >
GraphQL: Migrating From Apollo-Server-Express 1.0 To 2.0
Other GraphQL Server frameworks include Graphql-Yoga, Prisma, and even the team over at Facebook's GraphQL-Express. I actually started off using Facebook's ...
Read more >
GraphQL + TypeScript - A progressive Node.js framework
Both are exported from the @nestjs/mercurius package. ... source of truth -- each change made within SDL forces us to adjust TypeScript definitions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found