-
-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8be686a
commit f7eab8f
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/HotChocolate/Fusion/test/Composition.Tests/EnumMergeTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Xunit.Abstractions; | ||
|
||
namespace HotChocolate.Fusion.Composition; | ||
|
||
public class EnumMergeTests(ITestOutputHelper output) : CompositionTestBase(output) | ||
{ | ||
[Fact] | ||
public async Task Output_Enum() | ||
=> await Succeed( | ||
""" | ||
type Query { | ||
field1: Enum1! | ||
} | ||
enum Enum1 { | ||
BAR | ||
} | ||
""", | ||
""" | ||
type Query { | ||
field1: Enum1! | ||
} | ||
enum Enum1 { | ||
BAZ | ||
} | ||
"""); | ||
} |
19 changes: 19 additions & 0 deletions
19
...tChocolate/Fusion/test/Composition.Tests/__snapshots__/EnumMergeTests.Output_Enum.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
schema | ||
@fusion(version: 1) | ||
@transport(subgraph: "A", location: "https:\/\/localhost:5001\/graphql", kind: "HTTP") | ||
@transport(subgraph: "B", location: "https:\/\/localhost:5002\/graphql", kind: "HTTP") { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
field1: Enum1! | ||
@resolver(subgraph: "A", select: "{ field1 }") | ||
@resolver(subgraph: "B", select: "{ field1 }") | ||
} | ||
|
||
enum Enum1 { | ||
BAR | ||
@source(subgraph: "A") | ||
BAZ | ||
@source(subgraph: "B") | ||
} |