Comments (9)
@lorensr yes, I know the error. Just add this:
// We are doing this work-around because Playground sets headers and WebApp also sets headers
// Resulting into a conflict and a server side exception of "Headers already sent"
WebApp.connectHandlers.use('/graphql', (req, res) => {
if (req.method === 'GET') {
res.end();
}
});
from apollo.
@StorytellerCZ beautiful, I'm gonna roll-out the release and it will be fully BC. I've already managed to do it with beta, so that is crazy good news! It will be done next week.
from apollo.
I couldn't figure out how to connect WebApp with 2.0. I tried a few variations and gave up pretty quick since it's beta anyway. I think it has something to do with the built-in http server in 2.0.
from apollo.
@mattblackdev that would be bad, unless meteor would have a way to start without it's http server. But I'm sure they would still want to be able to apply themselves to express() or others.
I think there should be a way for this: https://www.apollographql.com/docs/apollo-server/v2/essentials/server.html#middleware
from apollo.
How would you obtain a reference to the express app?
registerServer({ server, app }); // app is from an existing express app
This is exactly what I tried but I don't think I figured out the right "app" reference. I filed an issue on apollo-server
from apollo.
Haven't tested yet myself, but apparently there is a newer version not yet referenced in the docs:
apollo-server-express@rc
"[...] with apollo-server-express rc, you can import the ApolloServer class without the dependency on apollo-sever"
And to answer my own question about WebApp
, use connectHandlers
.
I'm guessing it goes something like:
import { ApolloServer } from 'apollo-server-express'
import { WebApp } from 'meteor/webapp'
const server = new ApolloServer()
server.applyMiddleware({
app: WebApp.connectHandlers,
server,
path: '/graphql'
})
from apollo.
That is excellent. I'm waiting for the release but this looks promising, we're gonna remove a bunch of npm dependencies!
from apollo.
Looks like it is out: https://blog.apollographql.com/announcing-apollo-server-2-2b69fb4702ce
from apollo.
server.applyMiddleware({ app: WebApp.connectHandlers,
Were you able to get this working? I'm getting Error: Can't set headers after they are sent
:
apollographql/meteor-integration#123 (comment)
from apollo.
Related Issues (20)
- Authentication Directives HOT 1
- [Question] Fields resolved by external API HOT 6
- me query returns null HOT 6
- apollo db not work HOT 2
- [Question] How to expose links' metadata in schema HOT 1
- Shouldn't require resolvers for links. HOT 2
- Query lock-down on production
- Decouple Apollo Client to NPM
- Could I use this package for `Meteor + Vue`? HOT 2
- Get `userId = null`? HOT 1
- See what we can learn from here.
- Get the loader from cultofcoders:apollo
- Deep filtering
- `userId` is `undefined` in `matb33:collection-hooks` HOT 1
- Support Apollo Client 3.0
- test 2 p
- test 1 p
- test 1
- Project Management
- \ttest se tset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo.