AEB-labs / graphql-weaver

A tool to combine, link and transform GraphQL schemas
MIT License
240 stars 20 forks source link

Relay support #2

Open FX-HAO opened 7 years ago

FX-HAO commented 7 years ago

Hi! Thank you so very kindly for the work! This is a tremendous piece of work!

However, I'd one question regarding "production-ready" status of the project.

Does graphql-weaver support Relay?

Yogu commented 7 years ago

Hi,

thanks for the feedback. I'd consider graphql-weaver in the public beta status. We tested a wide range of use cases and edge cases (see these regression tests). But I'm sure there are still some cases where you might stumble upon a problem, see e.g. issue #3. Those are relatively easy to fix, but it's hard to anticipate every case in advance. We use it for active app development, but not in production yet.

Regarding relay: From a graphql perspective, there is nothing special about relay, so it should work just fine. Our special features like join however do not have support for relay-style connections, so no paging in joined fields yet.

FX-HAO commented 7 years ago

But there are some special cases, such as Relay Classic needs the node field on the root of Query, see: https://github.com/apollographql/graphql-tools/pull/382#issuecomment-329097473. BTW, Relay Modern seems that it does not need the node field.

Yogu commented 7 years ago

So I guess that would require a field node in the root type that accepts an id and decides from this id which endpoint it needs to call to resolve this field. This is currently not supported, but would fit well into the architecture. I think it would be a valuable addition, even if relay modern does not need it. I see if I find time to implement it in the near future. If you want to contribute, I can also give you some pointers where to start.

FX-HAO commented 7 years ago

I don't have much time right now, but i'd like to contribute it when i am free. It's nice to provide your advices, it's helpful to me or someone who wants to contribute.

Yogu commented 7 years ago

Ok, a rough outline: