Open mslabko opened 4 years ago
Hi @mslabko. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
As a developer, I want to have only one mapping, that can be used for
transform GQL query to Storefront APP request transform Storefront App response to GQL response
I think this user-story needs an explanation for the why, rather than just the what. My understanding was that it was not an explicit goal of this project for the shape of the data in proto messages to match the shape of the GraphQL data. I think that would need to be a prerequisite for this project if we want to go down that path, so shapes don't diverge.
For the time being, there haven't been any plans for automatic mapping between proto/gRPC and GraphQL schemas. I'd love to avoid creating this kind of mapping abstraction early on until it's needed.
Ideally, we'll do the most basic integration strategy possible from the node.js server, and we can look at a configurable mapping layer when/if we find the simpler strategy unwieldy.
If we try to invent something this early on we'll likely end up with an ill fitting abstraction (GraphQL stuff can get complicated on its own pretty fast).
we still need a mapping between GQL and Storefront APP ("proto") due to we not going to introduce new GQL schema
And my idea was to create pretty simple abstraction that will allow "just write mapping". In other case we will have N different solutions (answer for why) for mapping from GQL to Storefront and vise-versa
we still need a mapping between GQL and Storefront APP ("proto") due to we not going to introduce new GQL schema
Can you clarify what you mean here? That's what resolvers are for in GraphQL. Field gets invoked, then you fetch the data you need to satisy the schema.
As a developer, I want to have only one mapping, that can be used for
Due to we going to have support for webonyx GQL client (PHP) and NodeJS GQL client (javascript) we can build this mapping in json format to reuse between systems
Example
in this example (taking into account mapping above) we can:
Open questions: