Git Product home page Git Product logo

Comments (12)

TimMikeladze avatar TimMikeladze commented on March 29, 2024 3

Yep, going through the code now. Will send a PR.

from apollo-server.

helfer avatar helfer commented on March 29, 2024 1

@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.

helfer avatar helfer commented on March 29, 2024

@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.

helfer avatar helfer commented on March 29, 2024

Awesome!

from apollo-server.

helfer avatar helfer commented on March 29, 2024

@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.

bkinsey808 avatar bkinsey808 commented on March 29, 2024

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.

nnance avatar nnance commented on March 29, 2024

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:

  1. Apollo Server would be a class that would be instantiated with a schema and validation rules
  2. 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.

HriBB avatar HriBB commented on March 29, 2024

I use Koa and would love to help. Will check out your implementation soon

from apollo-server.

helfer avatar helfer commented on March 29, 2024

I will try to do start a rewrite today, and do #11 at the same time.

from apollo-server.

nnance avatar nnance commented on March 29, 2024

@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.

HriBB avatar HriBB commented on March 29, 2024

@helfer sure, I can give it a try. Will do some research ...

from apollo-server.

helfer avatar helfer commented on March 29, 2024

Closing this in favor of #11, which is implemented in typescript.

from apollo-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.