Skip to content

Commit

Permalink
[graphql] handle config mapped resources (#25793)
Browse files Browse the repository at this point in the history
I dropped some handling here
https://github.com/dagster-io/dagster/pull/25552/files#r1833202428
thinking it was for `mode` which is now defunct, but this can still
happen so handle it. Since the config type is nullable the behavior is
the same so this just gracefully handles the condition without error.

## How I Tested These Changes

loaded a job in the UI that was previously failing, now loads without
error
  • Loading branch information
alangenfeld authored and benpankow committed Nov 7, 2024
1 parent 779a48b commit 48d207a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def __init__(

def resolve_configField(self, _: ResolveInfo):
if self._logger_def_snap.config_field_snap:
try:
# config type may not be present if mode config mapped, null out gracefully
self._get_config_type(self._logger_def_snap.config_field_snap.type_key)
except KeyError:
return None

return GrapheneConfigTypeField(
self._get_config_type,
field_snap=self._logger_def_snap.config_field_snap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ def __init__(

def resolve_configField(self, _graphene_info: ResolveInfo):
if self._resource_def_snap.config_field_snap:
try:
# config type may not be present if mode config mapped, null out gracefully
self._get_config_type(self._resource_def_snap.config_field_snap.type_key)
except KeyError:
return None

return GrapheneConfigTypeField(
get_config_type=self._get_config_type,
field_snap=self._resource_def_snap.config_field_snap,
Expand Down

0 comments on commit 48d207a

Please sign in to comment.