You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to filter out certain fields in the source schema, but still be able to use that source's SDK to query that field. For example, I might write an additional typedef that matches the same type as the filtered field, and a custom resolver for it that queries the filtered field in the source, supplying the selection set from client query.
At the moment I can't do this, because filtering a field removes it from the SDK. I can work around it by renaming the field to "make space" in the stitched schema for the additional typedef, and then using a root-level filter to hide the renamed field. However, this makes the meshrc unnecessarily complicated, and means I have to refer to the renamed field on the SDK, rather than the original name. This also complicates thing unnecessarily.
Describe the solution you'd like
I can think of a couple of options:
a) Generate an SDK for the untransformed source schema, and place it in the context alongside the SDK that's currently being generated for the transformed source schema. e.g. something like
This is simple, but wouldn't allow the usage of any useful transforms like caches. We'd also have to think about name collisions.
b) Have the ability to define a source which is never actually stitched. This would allow the use of transforms, and the developer would be responsible for choosing the name.
My preference is for (b) and I will start building a PR for that, but I'm interested to hear about other opinions.
The text was updated successfully, but these errors were encountered:
Related to #3367.
I want to be able to filter out certain fields in the source schema, but still be able to use that source's SDK to query that field. For example, I might write an additional typedef that matches the same type as the filtered field, and a custom resolver for it that queries the filtered field in the source, supplying the selection set from client query.
At the moment I can't do this, because filtering a field removes it from the SDK. I can work around it by renaming the field to "make space" in the stitched schema for the additional typedef, and then using a root-level filter to hide the renamed field. However, this makes the meshrc unnecessarily complicated, and means I have to refer to the renamed field on the SDK, rather than the original name. This also complicates thing unnecessarily.
Describe the solution you'd like
I can think of a couple of options:
a) Generate an SDK for the untransformed source schema, and place it in the context alongside the SDK that's currently being generated for the transformed source schema. e.g. something like
This is simple, but wouldn't allow the usage of any useful transforms like caches. We'd also have to think about name collisions.
b) Have the ability to define a source which is never actually stitched. This would allow the use of transforms, and the developer would be responsible for choosing the name.
My preference is for (b) and I will start building a PR for that, but I'm interested to hear about other opinions.
The text was updated successfully, but these errors were encountered: