Comments (12)
Yep, going through the code now. Will send a PR.
from apollo-server.
@nnance Yes, we can definitely split it up. I think the easiest way is if I write the core, and you write the bindings for express and HAPI.
@HriBB would you be interested in writing the bindings for Koa?
from apollo-server.
@TimMikeladze Yeah, we have an issue open on graphql-tools (which originally contained apollo server) ardatan/graphql-tools#6
Would be great to use Typescript for apollo-server as well, and should be less work than for graphql-tools, because there's less code. Do you want to take a stab at it and work on a PR? I'm sure @jbaxleyiii would be happy to give guidance.
from apollo-server.
Awesome!
from apollo-server.
@nnance also expressed interest in working on this. We could do this rewrite in conjunction with adding Hapi support. Let's use this issue thread to talk about the typescript implementation, and how we can factor out the core parts of Apollo server so it's easy to write bindings for Hapi, Express and Koa!
from apollo-server.
Hi folks, I'm interested in possibly helping with this. I like typescript and I like graphql, so what will it take to get these two playing nicely together on the server?
from apollo-server.
I have started a prototype of the architecture I would recommend based on TypeScript. You can find it here. I will try to have it working with Express and Hapi by the end of the day. This is a super naive implementation but represents the architecture I would recommend. Apollo server should be a wrapper / extension of the core Graphql JS library and completely separated from the web frameworks like Express, Hapi, Koa, etc. In fact the Apollo server should have an API that doesn't interact with the aspects of HTTP (Request, Response) at all. To this point I think we should start a conversation of what the API for Apollo Server should be. From there we can divid up the work with someone building the Apollo Server core and others building the web framework wrappers. To start the conversation I would recommend the following:
- Apollo Server would be a class that would be instantiated with a schema and validation rules
- It would have a method called fulfillQuery that would parse, validate and execute the query returning an object that would contain an errors and or data
This matches my prototype. However, we could change the api to separate the calls to parse, validate and execute much like the Graphql api. I prefer a simple api.
Thoughts?
from apollo-server.
I use Koa and would love to help. Will check out your implementation soon
from apollo-server.
I will try to do start a rewrite today, and do #11 at the same time.
from apollo-server.
@helfer I am interested in helping if you can think of a plan to divid up the work. just let me know.
from apollo-server.
@helfer sure, I can give it a try. Will do some research ...
from apollo-server.
Closing this in favor of #11, which is implemented in typescript.
from apollo-server.
Related Issues (20)
- ApolloServerPluginUsageReporting does not allow to pass http agent HOT 2
- Apis that have their requests cached dont need to make unnecessary auth token fetches
- Document known mitigated security issue in `@koa/cors` for AS3 users HOT 1
- Update `@koa/cors` dependency for AS3 (or why we don't intend to) HOT 2
- Share and modify variables between Express and the GraphQL/Apollo server HOT 1
- Error: ApolloServer<BaseContext>' is not assignable to type 'ApolloServer<ExpressContext> HOT 3
- callback function for onSchemaLoadOrUpdate when upgrading from AS v3 to AS v4 HOT 3
- Allow plugins to throw meaningful GraphQL errors
- Getting started tutorial has typescript issues...
- Delay when subscription is closed on client side of the router when using callback
- Documentation and dynamic cache control feature of Apollo leverages incompatible GraphQl type interface. HOT 4
- Disabling introspection should also disable "Did you mean ...?" HOT 3
- Undefined 'code' TypeError within errorNormalize HOT 2
- Link broken for plugin
- The server crashes if a promise with deferred handling rejects while another promise is trying to resolve HOT 7
- Upgrade Express version to mitigate the Open Redirect Vulnerability in Express.js for malformed URLs, specifically targeting versions below 4.19.2. HOT 1
- Marking text works unreliable
- CodeSandbox setup is failing HOT 1
- Passing context to datasource loses it's reference, meaning, we cannot mutate the context between the resolver and datasources. HOT 2
- Provide basic CSS formatting for markdown rendered in description fields for the sandbox
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-server.