Code Monkey home page Code Monkey logo

Comments (9)

kbrandwijk avatar kbrandwijk commented on August 31, 2024 3

I am currently looking to go down the following path. I will release a openapi specific version of graphql-binding (similar to graphql-binding-github), that uses swagger-to-graphql internally. This way, you will be able to set up a binding like this:

import { Binding } from 'graphql-binding-openapi'
...
context: req => {
    myBinding: new Binding({ definition: './definition.json', endpoint: 'http://myserver.....' })
}
...

from graphql-binding.

kbrandwijk avatar kbrandwijk commented on August 31, 2024 1

I checked this out a bit more. The OpenAPI specification should be the basis for this. Swagger has https://github.com/swagger-api/swagger-codegen, which is a collection of many, many, generators for clients, servers, etc. I think generating a GraphQL binding should be one of those generators. I will look into this in more detail, and draft a proposal.

from graphql-binding.

kbrandwijk avatar kbrandwijk commented on August 31, 2024 1

@ntziolis Thank you very much for pointing to that library. It looks good, and seems easily integratable with graphql-binding and yoga (by using the schema it exposes as input for graphql-binding and adding that proxyURL to the context in yoga). I'll put it on my list to experiment with it.

from graphql-binding.

ntziolis avatar ntziolis commented on August 31, 2024 1

The key and graphcool specific piece will be to handle things like pagination, aggregates etc. For that I would suggest using an architecture that allows for all graphql implementations to share a common base and to allow it to be configurable for each implementation. lmk how experiments go I'm happy to help. This is on top of my current want to have list.

from graphql-binding.

ntziolis avatar ntziolis commented on August 31, 2024

Not sure how extensive this covers all cases but this package seems to be fairly actively used:
https://www.npmjs.com/package/swagger-to-graphql

Anybody experience with this lib?

from graphql-binding.

export-mike avatar export-mike commented on August 31, 2024

this project just keeps on giving! 👀 "following"

from graphql-binding.

kbrandwijk avatar kbrandwijk commented on August 31, 2024

The binding is released: https://github.com/graphql-binding/graphql-binding-openapi. Please feel free to open an issue on that repo for additional questions/requests/issues regarding REST API support.

from graphql-binding.

ntziolis avatar ntziolis commented on August 31, 2024

Wow tust was a Quick Turn around!

from graphql-binding.

Urigo avatar Urigo commented on August 31, 2024

In the last few months, since the transition of many libraries under The Guild's leadership, We've reviewed and released many improvements and versions to graphql-cli, graphql-config and graphql-import.

We've reviewed graphql-binding, had many meetings with current users and engaged the community also through the roadmap issue.

What we've found is that the new GraphQL Mesh library is covering not only all the current capabilities of GraphQL Binding, but also the future ideas that were introduced in the original GraphQL Binding blog post and haven't come to life yet.

And the best thing - GraphQL Mesh gives you all those capabilities, even if your source is not a GraphQL service at all!
it can be GraphQL, OpenAPI/Swagger, gRPC, SQL or any other source!
And of course you can even merge all those sources into a single SDK.

Just like GraphQL Binding, you get a fully typed SDK (thanks to the protocols SDKs and the GraphQL Code Generator), but from any source, and that SDK can run anywhere, as a connector or as a full blown gateway.
And you can share your own "Mesh Modules" (which you would probably call "your own binding") and our community already created many of those!
Also, we decided to simply expose regular GraphQL, so you can choose how to consume it using all the awesome fluent client SDKs out there.

If you think that we've missed anything from GraphQL Binding that is not supported in a better way in GraphQL Mesh, please let us know!


In the context of that particular issue - Supporting REST was the original goal of GraphQL Mesh so I'm pretty sure we cover that use case very nicely.
But, if you think something might be missing in GraphQL Mesh, please feel free to open a new issue on the GraphQL Mesh repo.

We're looking forward for your feedback of how we can make your experience even better!

from graphql-binding.

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.