def optimize_resolve_shipping_tracking_url(query_parent_path): query_child_path = '.'.join( [query_parent_path, 'shipping_method', 'carrier']) return OptimizeResolveTuple(query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=None)
def optimize_resolve_subscription_snapshot(query_parent_path): query_child_path = '.'.join( [query_parent_path, 'subscription_snapshot']) return OptimizeResolveTuple(query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=UserSubscriptionSnapshot)
def optimize_resolve_accepted_offer(query_parent_path): query_child_path = '.'.join([query_parent_path, 'accepted_offers']) return OptimizeResolveTuple( query_options=selectinload(query_child_path), query_child_path=query_child_path, child_node_class=ProductOffer)
def optimize_resolve_domain_card(query_parent_path): query_child_path = '.'.join([query_parent_path, 'card']) return OptimizeResolveTuple( query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=DomainCard )
def optimize_resolve_followed_creators(query_parent_path): query_child_path = '.'.join([query_parent_path, 'followed_creators']) return OptimizeResolveTuple( query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=User )
def optimize_resolve_user_subscription(query_parent_path): query_child_path = '.'.join([query_parent_path, 'primary_user_subscription']) return OptimizeResolveTuple( query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=UserSubscription )
def optimize_resolve_user(query_parent_path): from core.graphql.schemas.user import User # TODO otereshchenko: better solution for circular dependency problem query_child_path = '.'.join([query_parent_path, 'user']) return OptimizeResolveTuple(query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=User)
def optimize_resolve_offer_items(query_parent_path): query_child_path = '.'.join([query_parent_path, 'offer_items']) return OptimizeResolveTuple( query_options=selectinload( query_child_path ), # TODO figure why this optimization doesn't work query_child_path=query_child_path, child_node_class=OfferItem)
def optimize_resolve_order(query_parent_path): from core.graphql.schemas.order import Order # TODO solve circular dependency query_child_path = '.'.join([query_parent_path, 'order']) return OptimizeResolveTuple(query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=Order)
def optimize_resolve_themes(query_parent_path): from core.graphql.schemas.theme import Theme # TODO otereshchenko: better solution for circular dependency problem query_child_path = '.'.join([query_parent_path, 'themes']) return OptimizeResolveTuple( query_options=selectinload(query_child_path), query_child_path=query_child_path, child_node_class=Theme, )
def optimize_resolve_source(query_parent_path): query_child_path = '.'.join([query_parent_path, 'source']) return OptimizeResolveTuple(query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=Source)
def optimize_resolve_theme_group(query_parent_path): query_child_path = '.'.join([query_parent_path, 'theme_group']) return OptimizeResolveTuple(query_options=joinedload(query_child_path), query_child_path=query_child_path, child_node_class=ThemeGroup)