Skip to content
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

Add validation rule to ensure that @override(from:) references an existing source schema #114

Open
glen-84 opened this issue Jan 7, 2025 · 3 comments

Comments

@glen-84
Copy link
Contributor

glen-84 commented Jan 7, 2025

No description provided.

@Aenimus
Copy link

Aenimus commented Jan 9, 2025

Would such validation inhibit migration? In a migration flow, I would expect the following (simplified) flow:

  1. Define @override on the field taking responsibility (the source, i.e., the graph defining the directive).
  2. Remove the field being overridden (the target, i.e., the graph defined under "from")
  3. Remove the @override directive from the defining graph.

Now imagine you're slowly migrating a monolith into microservices. Your intention is to remove the monolith at the end of the process. You override the last remaining field defined in the monolith. When you remove that monolith from composition, there is an error because @override references a service that no longer exists.

This then becomes a bit of a chicken and an egg problem. You need to remove the @override directive, but you also want to get rid of the service that has been migrated.

@Aenimus
Copy link

Aenimus commented Jan 9, 2025

I should have mentioned, the way WunderGraph currently handles this is by producing a warning rather than an error when a from argument refers to an unknown subgraph.

@dariuszkuc
Copy link

Yes this should be a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants