コード例 #1
0
    def resolve_pipelineSnapshotOrError(self, graphene_info, **kwargs):
        snapshot_id_arg = kwargs.get('snapshotId')
        pipeline_name_arg = kwargs.get('activePipelineName')
        check.invariant(
            not (snapshot_id_arg and pipeline_name_arg),
            'Cannot pass both snapshotId and activePipelineName',
        )
        check.invariant(snapshot_id_arg or pipeline_name_arg,
                        'Must set one of snapshotId or activePipelineName')

        if pipeline_name_arg:
            return get_pipeline_snapshot_or_error_from_pipeline_name(
                graphene_info, pipeline_name_arg)
        else:
            return get_pipeline_snapshot_or_error_from_snapshot_id(
                graphene_info, snapshot_id_arg)
コード例 #2
0
ファイル: roots.py プロジェクト: xyzlat/dagster
    def resolve_pipelineSnapshotOrError(self, graphene_info, **kwargs):
        snapshot_id_arg = kwargs.get('snapshotId')
        pipeline_selector_arg = kwargs.get('activePipelineSelector')
        check.invariant(
            not (snapshot_id_arg and pipeline_selector_arg),
            'Must only pass one of snapshotId or activePipelineSelector',
        )
        check.invariant(
            snapshot_id_arg or pipeline_selector_arg,
            'Must set one of snapshotId or activePipelineSelector',
        )

        if pipeline_selector_arg:
            pipeline_selector = pipeline_selector_from_graphql(
                graphene_info.context, kwargs['activePipelineSelector'])
            return get_pipeline_snapshot_or_error_from_pipeline_selector(
                graphene_info, pipeline_selector)
        else:
            return get_pipeline_snapshot_or_error_from_snapshot_id(
                graphene_info, snapshot_id_arg)