-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for schema transformations #130
Comments
An alternative approach could be to introduce a sealed trait I'll sketch this with a simple transformation like renaming types. |
Did a proof of concept that seems OK with the following API: api
.transform(Transformer.RenameType(t => if (t.contains("Queries")) Some("QueriesYOLO") else None))
.transform(Transformer.FilterType(t => t != "character")) |
Any progress on this? |
No one manifested interest so far so I didn't go further, but I could potentially resurrect my old prototype. I can't find the Apollo docs anymore but found this https://the-guild.dev/graphql/stitching/docs/transforms |
Makes me wonder how many people actually use Apollo federation.. I just finished merging our APIs into a super-graph for use with Apollo Router. I was able to sort the conflicts by making some types sharable and wrapping queries\mutations so far. Nevertheless I got uneasy feeling that every time I modify a sub-graph service I might introduce a new conflict. With your proposed feature I could just add a prefix to every type name. |
@DGolubets we use Apollo federation. We run schema validation vs the supergraph in CI to avoid introducing conflicts / breaking changes (via the It's also very possible to share types between subgraphs, esp. so with federation v2. |
Something similar to this Apollo-server feature: https://www.apollographql.com/docs/apollo-server/features/schema-transforms/
The current problem is that Caliban currently stores runtime schema into this object:
__Type
matches the graphql type used by introspection, whileStep
is a description of a computation, that might require running some effects to get the underlying steps. If you want to remove or rename a field, it needs to be applied in both structures, which isn't really possible in the case ofStep
.We need to think of a different way of encoding the resolver to support this feature. Maybe
Step
is generated too early and there should be something in between.The text was updated successfully, but these errors were encountered: