Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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
        )
Exemple #5
0
    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
        )
Exemple #6
0
    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
        )
Exemple #7
0
    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)
Exemple #8
0
    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)
Exemple #9
0
    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)
Exemple #10
0
    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,
        )
Exemple #11
0
    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)
Exemple #12
0
    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)