Git Product home page Git Product logo

Comments (5)

ozanmakes avatar ozanmakes commented on June 4, 2024

@andreas

Could you use use HTTP server that ships with graphql-lwt, or does it lack some feature compared to the one you implemented? At a glance they seem quite similar.

I'm guessing it's because of the static file serving logic. I had to do something similar to customize the included GraphiQL page.

Is there a way to include the module and override the assets/route handlers without vendoring graphql_lwt?

from reason-graphql-fullstack.

anmonteiro avatar anmonteiro commented on June 4, 2024

@osener that's indeed the reason; @andreas and I talked on Discord about it and I never responded in this issue.

Is there a way to include the module and override the assets/route handlers without vendoring graphql_lwt?

I think that's what this issue is for, correct me if I'm wrong: andreas/ocaml-graphql-server#93

from reason-graphql-fullstack.

andreas avatar andreas commented on June 4, 2024

If I understand you correctly, what you're looking for is a way to compose the GraphQL HTTP handler with other routes. To that effect, Graphql_lwt.Server could expose a function with the following type

'ctx Graphql_lwt.Schema.schema ->
Cohttp.Request.t ->
Body.t ->
'ctx ->
(Cohttp.Response.t * Body.t) Lwt.t

Is it something like that you're looking for?

I don't consider andreas/ocaml-graphql-server#93 to be about such a function, that's simply moving the HTTP server to it's own OPAM package.

from reason-graphql-fullstack.

anmonteiro avatar anmonteiro commented on June 4, 2024

That sounds like a good idea but I'd still put it in the separate package that andreas/ocaml-graphql-server#93 is about.

If I wanna use ocaml-graphql-server with Httpaf, for example, I wouldn't want there to be Cohttp dependencies in the dependency I'm pulling.

from reason-graphql-fullstack.

andreas avatar andreas commented on June 4, 2024

@anmonteiro that makes sense 👍

from reason-graphql-fullstack.

Related Issues (5)

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.