Skip to content

Commit

Permalink
[gql] add id to resource, asset group gql objects (#16857)
Browse files Browse the repository at this point in the history
## Summary

Introduces an id field to external resource and asset group objects

---------

Co-authored-by: Isaac Hellendag <[email protected]>
  • Loading branch information
benpankow and hellendag authored Sep 27, 2023
1 parent 15fabaf commit 1a06f30
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 11 deletions.

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

4 changes: 4 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/graphql/types.ts

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 @@ -220,6 +220,7 @@ const OVERVIEW_RESOURCES_QUERY = gql`
id
name
allTopLevelResourceDetails {
id
...ResourceEntryFragment
}
}
Expand Down

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 @@ -152,6 +152,7 @@ const WORKSPACE_RESOURCES_QUERY = gql`
id
name
allTopLevelResourceDetails {
id
...ResourceEntryFragment
}
}
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.

Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export const SEARCH_PRIMARY_QUERY = gql`
id
name
assetGroups {
id
groupName
}
pipelines {
Expand All @@ -267,6 +268,7 @@ export const SEARCH_PRIMARY_QUERY = gql`
pipelineName
}
allTopLevelResourceDetails {
id
name
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ export const ROOT_WORKSPACE_QUERY = gql`
pipelineName
}
assetGroups {
id
groupName
}
allTopLevelResourceDetails {
id
name
}
...RepositoryInfoFragment
Expand Down

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 @@ -1104,6 +1104,7 @@ def resolve_assetChecks(self, graphene_info: ResolveInfo) -> List[GrapheneAssetC


class GrapheneAssetGroup(graphene.ObjectType):
id = graphene.NonNull(graphene.String)
groupName = graphene.NonNull(graphene.String)
assetKeys = non_null_list(GrapheneAssetKey)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def resolve_assetGroups(self, _graphene_info: ResolveInfo):

return [
GrapheneAssetGroup(
group_name, [external_node.asset_key for external_node in external_nodes]
f"{self._repository_location.name}-{self._repository.name}-{group_name}",
group_name,
[external_node.asset_key for external_node in external_nodes],
)
for group_name, external_nodes in groups.items()
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Meta:


class GrapheneResourceDetails(graphene.ObjectType):
id = graphene.NonNull(graphene.String)
name = graphene.NonNull(graphene.String)
description = graphene.String()
configFields = graphene.Field(
Expand Down Expand Up @@ -112,6 +113,8 @@ def __init__(
):
super().__init__()

self.id = f"{location_name}-{repository_name}-{external_resource.name}"

self._location_name = check.str_param(location_name, "location_name")
self._repository_name = check.str_param(repository_name, "repository_name")

Expand Down

1 comment on commit 1a06f30

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-k2v14gv00-elementl.vercel.app

Built with commit 1a06f30.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.