Skip to content

Commit

Permalink
[dagit] Add dummy graphName field to AssetNode (#7637)
Browse files Browse the repository at this point in the history
## Summary

Add a `graphName` field to `AssetNode`. Just returns the first op name for now.

## Test Plan

Load Dagit, view an asset, verify that `graphName` has been populated in the query response.
  • Loading branch information
hellendag committed Apr 28, 2022
1 parent 8ab7bfb commit 5870039
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export const ASSET_NODE_LIVE_FRAGMENT = gql`
export const ASSET_NODE_FRAGMENT = gql`
fragment AssetNodeFragment on AssetNode {
id
graphName
opName
opNames
description
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions js_modules/dagit/packages/core/src/assets/types/AssetQuery.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js_modules/dagit/packages/core/src/graphql/schema.graphql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class GrapheneAssetNode(graphene.ObjectType):
dependencies = non_null_list(GrapheneAssetDependency)
dependencyKeys = non_null_list(GrapheneAssetKey)
description = graphene.String()
graphName = graphene.String()
id = graphene.NonNull(graphene.ID)
jobNames = non_null_list(graphene.String)
jobs = non_null_list(GraphenePipeline)
Expand Down Expand Up @@ -294,6 +295,13 @@ def resolve_dependencies(self, graphene_info) -> List[GrapheneAssetDependency]:
for dep in self._external_asset_node.dependencies
]

def resolve_graphName(self, _graphene_info) -> Optional[str]:
# todo OwenKephart - return the correct graph name here
if self._external_asset_node.op_name:
return self._external_asset_node.op_name
else:
return None

def resolve_jobNames(self, _graphene_info) -> List[str]:
return self._external_asset_node.job_names

Expand Down

0 comments on commit 5870039

Please sign in to comment.