Skip to content

Commit 132eadf

Browse files
committed
revert: remove step-based parameterized GQL catalog entries
Reverts the IHasItemDependencies pattern from commit 5639dda. That approach injected step-level computation (runtime dependency resolution) into the catalog layer, violating the catalog-owns-declaration / steps-own-computation boundary and introducing hidden runtime dependencies invisible to the type system. To be replaced with GqlQuery<TResult,T> — a deferred query handle analogous to TypedFrame<T> in the Spark extension, where the step decides when to materialize.
1 parent 5639dda commit 132eadf

17 files changed

Lines changed: 5 additions & 786 deletions

File tree

examples/advanced/KedroSpaceflightsGQL/Data/_01_Raw/Catalog.Raw.cs

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public partial class Catalog
7070
);
7171

7272
/// <summary>
73-
/// Raw shuttle data queried from the GQL server (all shuttles, unfiltered).
73+
/// Raw shuttle data queried from the GQL server.
7474
/// </summary>
7575
public IItem<IEnumerable<IGetShuttles_Shuttles>> Shuttles =>
7676
CreateItem(
@@ -96,42 +96,4 @@ public partial class Catalog
9696
allowEmptyData: true
9797
)
9898
);
99-
100-
// ── Parameterized GQL entries — consumed by the Analytics flow ──────────
101-
102-
/// <summary>
103-
/// The company ID of the highest-rated company. Written by FindTopRatedCompany;
104-
/// used as the parameter source for <see cref="TopRatedCompanyShuttles"/>.
105-
/// </summary>
106-
public IItem<string> TopRatedCompanyId =>
107-
CreateItem(() => ItemFactory.Single.Memory<string>("TopRatedCompanyId"));
108-
109-
/// <summary>
110-
/// Shuttles operated by the top-rated company — a parameterized GQL catalog entry.
111-
/// At load time, the adapter reads <see cref="TopRatedCompanyId"/> and fires a
112-
/// filtered <c>GetShuttlesByCompanyId</c> query. Only that company's shuttles are
113-
/// transferred; the full shuttle dataset is never pulled.
114-
/// </summary>
115-
/// <remarks>
116-
/// The dependency analyzer discovers that this item's adapter depends on
117-
/// <see cref="TopRatedCompanyId"/>. Any step consuming <see cref="TopRatedCompanyShuttles"/>
118-
/// is automatically scheduled after the step that produces
119-
/// <see cref="TopRatedCompanyId"/>, with no explicit ordering required in the flow
120-
/// definition.
121-
/// </remarks>
122-
public IItem<IEnumerable<IGetShuttlesByCompanyId_Shuttles>> TopRatedCompanyShuttles =>
123-
CreateItem(
124-
() =>
125-
GqlItemFactory.Enumerable.Query<
126-
string,
127-
IGetShuttlesByCompanyIdResult,
128-
IGetShuttlesByCompanyId_Shuttles
129-
>(
130-
label: "GQLTopRatedCompanyShuttles",
131-
parameterSource: TopRatedCompanyId,
132-
queryFunc: (companyId, ct) => _client.GetShuttlesByCompanyId.ExecuteAsync(companyId, ct),
133-
selectData: r => r.Shuttles,
134-
allowEmptyData: true
135-
)
136-
);
13799
}

examples/advanced/KedroSpaceflightsGQL/Data/_08_Reporting/Catalog.Reporting.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,6 @@ public partial class Catalog
2222
)
2323
);
2424

25-
/// <summary>
26-
/// Fleet summary for the top-rated company, produced by the Analytics flow.
27-
/// Demonstrates that the consuming step receives plain materialized data and has
28-
/// no awareness of the parameterized GQL query that fetched it.
29-
/// </summary>
30-
public IItem<TopRatedCompanyReport> TopRatedCompanyReport =>
31-
CreateItem(
32-
() =>
33-
ItemFactory.Single.Json<TopRatedCompanyReport>(
34-
label: "TopRatedCompanyReport",
35-
filePath: $"{_basePath}/_08_Reporting/Datasets/top_rated_company_report.json"
36-
)
37-
);
38-
3925
/// <summary>
4026
/// Shuttle passenger capacity bar chart (in-memory GenericChart).
4127
/// Intermediate chart object stored in memory for downstream export to PNG.

examples/advanced/KedroSpaceflightsGQL/Data/_08_Reporting/Schemas/TopRatedCompanyReport.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

examples/advanced/KedroSpaceflightsGQL/Flows/Analytics/AnalyticsFlow.cs

Lines changed: 0 additions & 81 deletions
This file was deleted.

examples/advanced/KedroSpaceflightsGQL/Flows/Analytics/Steps/AnalyzeTopCompanyShuttlesStep.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/advanced/KedroSpaceflightsGQL/Flows/Analytics/Steps/FindTopRatedCompanyStep.cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

examples/advanced/KedroSpaceflightsGQL/Infra/GqlClient/Operations.graphql

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@ query GetShuttles {
2121
}
2222
}
2323

24-
query GetShuttlesByCompanyId($companyId: String!) {
25-
shuttles(companyId: $companyId) {
26-
id
27-
shuttleType
28-
companyId
29-
engines
30-
passengerCapacity
31-
crew
32-
price
33-
dCheckComplete
34-
moonClearanceComplete
35-
}
36-
}
37-
3824
query GetReviews {
3925
reviews {
4026
shuttleId

examples/advanced/KedroSpaceflightsGQL/Infra/GqlClient/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ input AddReviewInput {
5050

5151
type Query {
5252
companies: [CompanyRecord!]!
53-
shuttles(companyId: String): [ShuttleRecord!]!
53+
shuttles: [ShuttleRecord!]!
5454
reviews: [ReviewRecord!]!
5555
}
5656

examples/advanced/KedroSpaceflightsGQL/Infra/GqlServer/SpaceflightsGqlServer.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ public class Query
1212
public IReadOnlyList<CompanyRecord> GetCompanies([Service] SpaceflightsRepository repo) =>
1313
repo.GetCompanies();
1414

15-
public IReadOnlyList<ShuttleRecord> GetShuttles(
16-
[Service] SpaceflightsRepository repo,
17-
string? companyId = null
18-
) => companyId is not null ? repo.GetShuttlesByCompanyId(companyId) : repo.GetShuttles();
15+
public IReadOnlyList<ShuttleRecord> GetShuttles([Service] SpaceflightsRepository repo) =>
16+
repo.GetShuttles();
1917

2018
public IReadOnlyList<ReviewRecord> GetReviews([Service] SpaceflightsRepository repo) =>
2119
repo.GetReviews();

examples/advanced/KedroSpaceflightsGQL/Infra/GqlServer/SpaceflightsRepository.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ public IReadOnlyList<ShuttleRecord> GetShuttles()
3636
}
3737
}
3838

39-
public IReadOnlyList<ShuttleRecord> GetShuttlesByCompanyId(string companyId)
40-
{
41-
lock (_lock)
42-
{
43-
return _shuttles.Where(s => s.CompanyId == companyId).ToList();
44-
}
45-
}
46-
4739
public IReadOnlyList<ReviewRecord> GetReviews()
4840
{
4941
lock (_lock)

0 commit comments

Comments
 (0)