google / rejoiner

Generates a unified GraphQL schema from gRPC microservices and other Protobuf sources
https://google.github.io/rejoiner/
Apache License 2.0
3.67k stars 143 forks source link

Explain more about the FieldMasks usage #5

Closed alenkacz closed 6 years ago

alenkacz commented 6 years ago

Hi,

this is not really an issue per say but I tried really hard to figure out how does rejoiner work with FieldMasks but failed... Could you maybe @siderakis explain more? It sounds like super awesome feature... (not just for this library, also for other proto use cases).

This is what is written in the readme... Creates Proto FieldMasks based on GraphQL selectors

Thank you!

siderakis commented 6 years ago

Thanks for the question! I'm scrambling now to improve the docs.

I started this doc to explain how Rejoiner creates a FieldMask instance based on the GraphQL selectors. Currently it's only used in Projections, but something similar might work for update operations.

Let me know if you have something else in mind related to FieldMasks and GraphQL.

alenkacz commented 6 years ago

@siderakis Oh great, thank you!

Can you maybe point me to a place in this codebase when that happen? I went through grpc, protobuf and this codebase and still can't say I totally understand how rejoiner leverages FieldMasks.

For once I started with a simple "FieldMask" text search in this repo :) https://github.com/google/rejoiner/search?utf8=%E2%9C%93&q=fieldmask&type=

siderakis commented 6 years ago

Woops, I didn't open source this file yet!

I'll aim at getting it released today, but it does have a tricky dependency on our internal ExecutionStrategy that I have to remove first.

siderakis commented 6 years ago

https://github.com/google/rejoiner/blob/master/rejoiner/src/main/java/com/google/api/graphql/grpc/SelectorToFieldMask.java

Example usage and tests will be released soon.

alenkacz commented 6 years ago

Haha, thanks, that's what I thought. I'll wait then, thank you, great project! :-)