Skip to content
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

Feature/wait for mutation #102

Merged
merged 2 commits into from
Nov 8, 2024
Merged
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
5 changes: 5 additions & 0 deletions social_protection/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from core.custom_filters import CustomFilterWizardStorage
from core.gql_queries import ValidationMessageGQLType
from core.schema import OrderedDjangoFilterConnectionField
from core.services import wait_for_mutation
from core.utils import append_validity_filter, validate_json_schema
from social_protection.apps import SocialProtectionConfig
from social_protection.gql_mutations import (
Expand Down Expand Up @@ -178,6 +179,7 @@ def resolve_benefit_plan(self, info, **kwargs):

client_mutation_id = kwargs.get("client_mutation_id", None)
if client_mutation_id:
wait_for_mutation(client_mutation_id)
filters.append(Q(mutations__mutation__client_mutation_id=client_mutation_id))

individual_id = kwargs.get("individual_id", None)
Expand Down Expand Up @@ -353,6 +355,7 @@ def resolve_awaiting_beneficiary(self, info, **kwargs):

client_mutation_id = kwargs.get("client_mutation_id", None)
if client_mutation_id:
wait_for_mutation(client_mutation_id)
filters.append(Q(mutations__mutation__client_mutation_id=client_mutation_id))

Query._check_permissions(
Expand All @@ -367,6 +370,7 @@ def resolve_beneficiary_data_upload_history(self, info, **kwargs):

client_mutation_id = kwargs.get("client_mutation_id", None)
if client_mutation_id:
wait_for_mutation(client_mutation_id)
filters.append(Q(mutations__mutation__client_mutation_id=client_mutation_id))

Query._check_permissions(
Expand Down Expand Up @@ -409,6 +413,7 @@ def resolve_benefit_plan_history(self, info, **kwargs):

client_mutation_id = kwargs.get("client_mutation_id", None)
if client_mutation_id:
wait_for_mutation(client_mutation_id)
filters.append(Q(mutations__mutation__client_mutation_id=client_mutation_id))

individual_id = kwargs.get("individual_id", None)
Expand Down
Loading