Skip to content

[gql] latestEventSortKey resolver for GrapheneAsset so that we can order by id #29264

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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

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

5 changes: 5 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 @@ -21,6 +21,7 @@
RunRecord,
RunsFilter,
)
from dagster._core.storage.event_log.base import AssetRecord
from dagster._core.storage.tags import REPOSITORY_LABEL_TAG, RUN_METRIC_TAGS, TagType, get_tag_type
from dagster._core.workspace.permissions import Permissions
from dagster._utils.tags import get_boolean_tag_value
Expand Down Expand Up @@ -247,6 +248,7 @@ class GrapheneAsset(graphene.ObjectType):
cursor=graphene.String(),
)
definition = graphene.Field("dagster_graphql.schema.asset_graph.GrapheneAssetNode")
latestEventSortKey = graphene.Field(graphene.ID)

class Meta:
name = "Asset"
Expand Down Expand Up @@ -389,6 +391,12 @@ def resolve_assetObservations(
)
]

async def resolve_latestEventSortKey(self, graphene_info):
asset_record = await AssetRecord.gen(graphene_info.context, self.key)
if asset_record:
return asset_record.asset_entry.last_event_storage_id
return None


class GrapheneEventConnection(graphene.ObjectType):
class Meta:
Expand Down
Loading