yarax / swagger-to-graphql

Swagger to GraphQL API adapter
MIT License
924 stars 150 forks source link

Feature Request: Support Federation #139

Closed dwelch2344 closed 5 years ago

dwelch2344 commented 5 years ago

Any ideas on what it'd take to support Federation? Just getting my legs under me with it, but would be super nice if it could do it

0xR commented 5 years ago

Federation could be supported by something like schema transforms. I haven't tried it yet. I don't think it should be part of the swagger-to-graphql itself. An example could be added to the documentation.

For now I don't have time to investigate.

codef0rmer commented 5 years ago

@0xR I'm also wanting this implementation. But up until I was thinking that it's not possible (https://github.com/apollographql/apollo-server/pull/30130).

Can you atleast jot down your thoughts and approach to make it happen so that I can spend some time to code?

codef0rmer commented 5 years ago

@0xR I also noticed that the schema generated by this tool is an executable schema while Angular Server can not consume it.

0xR commented 5 years ago

Good news, I created the schema transform that I mentioned above. It could do with more documentation, but there is a working example. The idea is that you create the schema with swagger-to-graphql and add annotations with graphql-transform-federation.

https://github.com/0xR/graphql-transform-federation

dwelch2344 commented 5 years ago

This is awesome to hear. Excited to check it out. Thanks!

codef0rmer commented 5 years ago

but @0xR is it not on NPM?

0xR commented 5 years ago

Yes it is: https://www.npmjs.com/package/graphql-transform-federation