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

[WIP] [Fusion] Reproduce union list query plan issue #7685

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions src/HotChocolate/Fusion/test/Core.Tests/DemoIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,79 @@ public class DemoIntegrationTests(ITestOutputHelper output)
{
private readonly Func<ICompositionLog> _logFactory = () => new TestCompositionLog(output);

[Fact]
public async Task Test()
{
// arrange
var subgraphA = await TestSubgraph.CreateAsync(
"""
interface Node {
id: ID!
}

type Query {
productsA: [Product]
productsB: [Product]
node(id: ID!): Node
nodes(ids: [ID!]!): [Node]!
}

type Product implements Node {
id: ID!
name: String!
}
""");

var subgraphB = await TestSubgraph.CreateAsync(
"""
interface Node {
id: ID!
}

type Query {
node(id: ID!): Node
nodes(ids: [ID!]!): [Node]!
}

type Product implements Node {
id: ID!
price: Float!
reviewCount: Int!
}
""");

using var subgraphs = new TestSubgraphCollection(output, [subgraphA, subgraphB]);
var executor = await subgraphs.GetExecutorAsync();
var request = Parse("""
query {
productsA {
id
name
price
reviewCount
}
productsB {
id
name
price
reviewCount
}
}
""");

// act
var result = await executor.ExecuteAsync(
OperationRequestBuilder
.New()
.SetDocument(request)
.Build());

// assert
var snapshot = new Snapshot();
CollectSnapshotData(snapshot, request, result);
await snapshot.MatchMarkdownAsync();
}

[Fact]
public async Task Authors_And_Reviews_AutoCompose()
{
Expand Down
Loading
Loading