Enum was used as both an input and output but was inconsistently defined across inclusive subgraphs
When you receive an error like Enum X was used as both an input and output but was inconsistently defined across inclusive subgraphs it means you are publishing a change to an enum that is used as both an input and an output.When publishing a new enum value to a subgraph, depending on whether that enum is used as an input, output, or both, incompatibilities and run-time issues could arise.
For example, imagine Subgraph A defines an enum with value A, and it is used as an input.
However, Subgraph B defines the same enum with values A and B, and it is used as an output.
Composition cannot add value B to the federated graph because Subgraph A is unaware of value B and cannot accept it as a valid input.
Similarly, composition also cannot remove value B from the federated graph because then returning B from Subgraph B would be invalid.
In such an instance, the only way to prevent errors is to define the enum consistently across all subgraphs in which the enum appears.To solve this issue you should proceed as follows:
in the origin graph, add @inaccessible to Enum.NewValue
in each other subgraph that define the enum, define Enum.NewValue(no directive)
after you have published the change to all subgraphs that define that enum, remove @inaccessible from the origin subgraph and publish the change
This migration approach, while cumbersome, ensures that the federated contract is respected at all times, keeping your router safe from any run-time errors.