Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 2f99798

Browse files
committed
use explicit resolvers
1 parent a5e67d4 commit 2f99798

File tree

4 files changed

+35
-31
lines changed

4 files changed

+35
-31
lines changed

graphql_api/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
bundle_data_bindable,
1818
bundle_module_bindable,
1919
bundle_report_bindable,
20+
bundle_report_info_bindable,
2021
)
2122
from .commit import (
2223
commit,
@@ -148,6 +149,7 @@
148149
bundle_data_bindable,
149150
bundle_module_bindable,
150151
bundle_report_bindable,
152+
bundle_report_info_bindable,
151153
commit_bindable,
152154
commit_bundle_analysis_bindable,
153155
commit_coverage_analytics_bindable,

graphql_api/types/bundle_analysis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
bundle_data_bindable,
66
bundle_module_bindable,
77
bundle_report_bindable,
8+
bundle_report_info_bindable,
89
)
910
from .comparison import (
1011
bundle_analysis_comparison_bindable,
@@ -26,6 +27,7 @@
2627
"bundle_data_bindable",
2728
"bundle_module_bindable",
2829
"bundle_report_bindable",
30+
"bundle_report_info_bindable",
2931
"bundle_analysis_comparison_bindable",
3032
"bundle_analysis_comparison_result_bindable",
3133
"bundle_comparison_bindable",

graphql_api/types/bundle_analysis/base.graphql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type BundleAsset {
5858
routes: [String!]
5959
}
6060

61-
type BundleInfo {
61+
type BundleReportInfo {
6262
version: String!
6363
plugin_name: String!
6464
plugin_version: String!
@@ -92,7 +92,7 @@ type BundleReport {
9292
last: Int
9393
before: String
9494
): AssetConnection
95-
info: BundleInfo!
95+
info: BundleReportInfo!
9696
}
9797

9898
type BundleAnalysisMeasurements{

graphql_api/types/bundle_analysis/base.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
bundle_module_bindable = ObjectType("BundleModule")
3030
bundle_asset_bindable = ObjectType("BundleAsset")
3131
bundle_report_bindable = ObjectType("BundleReport")
32-
bundle_info_bindable = ObjectType("BundleInfo")
32+
bundle_report_info_bindable = ObjectType("BundleReportInfo")
3333

3434

3535
def _find_index_by_cursor(assets: List, cursor: str) -> int:
@@ -383,50 +383,50 @@ def resolve_bundle_report_info(
383383
return BundleReportInfo(bundle_report.info)
384384

385385

386-
@bundle_info_bindable.field("version")
387-
def resolve_bundle_info_version(
388-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
386+
@bundle_report_info_bindable.field("version")
387+
def resolve_bundle_report_info_version(
388+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
389389
) -> str:
390-
return bundle_info.version
390+
return bundle_report_info.version
391391

392392

393-
@bundle_info_bindable.field("plugin_name")
394-
def resolve_bundle_info_plugin_name(
395-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
393+
@bundle_report_info_bindable.field("plugin_name")
394+
def resolve_bundle_report_info_plugin_name(
395+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
396396
) -> str:
397-
return bundle_info.plugin_name
397+
return bundle_report_info.plugin_name
398398

399399

400-
@bundle_info_bindable.field("plugin_version")
401-
def resolve_bundle_info_plugin_version(
402-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
400+
@bundle_report_info_bindable.field("plugin_version")
401+
def resolve_bundle_report_info_plugin_version(
402+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
403403
) -> str:
404-
return bundle_info.plugin_version
404+
return bundle_report_info.plugin_version
405405

406406

407-
@bundle_info_bindable.field("built_at")
408-
def resolve_bundle_info_built_at(
409-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
407+
@bundle_report_info_bindable.field("built_at")
408+
def resolve_bundle_report_info_built_at(
409+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
410410
) -> str:
411-
return bundle_info.built_at
411+
return bundle_report_info.built_at
412412

413413

414-
@bundle_info_bindable.field("duration")
415-
def resolve_bundle_info_duration(
416-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
414+
@bundle_report_info_bindable.field("duration")
415+
def resolve_bundle_report_info_duration(
416+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
417417
) -> int:
418-
return bundle_info.duration
418+
return bundle_report_info.duration
419419

420420

421-
@bundle_info_bindable.field("bundler_name")
422-
def resolve_bundle_info_bundler_name(
423-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
421+
@bundle_report_info_bindable.field("bundler_name")
422+
def resolve_bundle_report_info_bundler_name(
423+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
424424
) -> str:
425-
return bundle_info.bundler_name
425+
return bundle_report_info.bundler_name
426426

427427

428-
@bundle_info_bindable.field("bundler_version")
429-
def resolve_bundle_info_bundler_version(
430-
bundle_info: BundleReportInfo, info: GraphQLResolveInfo
428+
@bundle_report_info_bindable.field("bundler_version")
429+
def resolve_bundle_report_info_bundler_version(
430+
bundle_report_info: BundleReportInfo, info: GraphQLResolveInfo
431431
) -> str:
432-
return bundle_info.bundler_version
432+
return bundle_report_info.bundler_version

0 commit comments

Comments
 (0)