Comments (5)
I agree both syntax options should work. This should and can be fixed in start()
, checking if the first parameter is a function.
from graphql-yoga.
I believe this is related to recent pull request 77 it looks like the callback isn't the first argument anymore. Shouldn't it be? since options are optional, shouldn't they go after?
from graphql-yoga.
Indeed changing the function call to:
server.start(null, () => console.log("Server is running on http://localhost:4000"));
fixes the problem and the callback gets executed. One could either change all the boilerplates and the docs to reflect this api change, or one could put the callback as the first argument. I'm in favor callbacks first.
from graphql-yoga.
I suppose that a good implementation with no options and a callback keeping with js conventions, would be:
const options = {}
server.start(options, () => console.log("Server is running on http://localhost:4000"))
I'd be cool with that, but then you gotta merge my pull requests for updating all of the examples and docs.
from graphql-yoga.
Both syntax options should be supported. This rather looks like a bug to me. @kbrandwijk what are your thoughts?
from graphql-yoga.
Related Issues (20)
- [plugins/prometheus] missing operation name in graphql_yoga_http_duration_count metric on status 400
- [integrations/fastify] Add documentation to enable SSE subscriptions HOT 4
- [useResponseCache] Provide server context to define session Id HOT 3
- docs(Getting started): Suggest code snippets that work without changes HOT 1
- `Must provide query string.` should not be an error HOT 6
- Project Roadmap
- Project Roadmap
- Document `waitUntil` function present in the server context
- [managed-federation] New plugin: `useManagedFederation` which loads and keeps up to date a GraphOS managed supergraph
- Typescript build fails for project using `type: module`
- uWebSockets duplicate set-cookie responses
- Add support for GraphiQL initial tabs HOT 2
- Setting `maskedErrors` to `true` in `development` mode has no effect HOT 2
- GraphQLError does not respect originalError HOT 3
- sofa plugin throws module not found error in ESM HOT 1
- problem with entities with multiple @keys: yoga + federation
- @graphql-yoga/plugin-prometheus breaks subscriptions over graphql-ws HOT 2
- Plugins not working in nestjs HOT 1
- Add a `createChild` method to the logger
- multipart stream is missing CRLF at beginning of first chunk HOT 2
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 graphql-yoga.