-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate GraphQL bindings from REST APIs #28
Comments
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. |
Not sure how extensive this covers all cases but this package seems to be fairly actively used: Anybody experience with this lib? |
@ntziolis Thank you very much for pointing to that library. It looks good, and seems easily integratable with |
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. |
this project just keeps on giving! 👀 "following" |
I am currently looking to go down the following path. I will release a openapi specific version of import { Binding } from 'graphql-binding-openapi'
...
context: req => {
myBinding: new Binding({ definition: './definition.json', endpoint: 'http://myserver.....' })
}
... |
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. |
Wow tust was a Quick Turn around! |
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 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! 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. 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. We're looking forward for your feedback of how we can make your experience even better! |
It should be possible to transform any REST API into a GraphQL binding, based on some kind of structured API documentation, such as Swagger / Open API docs.
Open questions:
The text was updated successfully, but these errors were encountered: