Skip to content

Do not execute FetchCartItems if there is no item #592

@NicolasMahe

Description

@NicolasMahe

Currently, if there is no item in the cart, the query FetchCartItems is executed with an empty filter that returns ALL the offer of the platform which takes a very long time.

{
    "operationName": "FetchCartItems",
    "variables": {
        "offerIds": []
    },
    "query": "query FetchCartItems($offerIds: [UUID!]!) {\n  listings(condition: {ids: $offerIds, status: [ACTIVE, EXPIRED]}) {\n    nodes {\n      id\n      type\n      expiredAt\n      maker {\n        address\n        name\n        image\n        verification {\n          status\n          __typename\n        }\n        __typename\n      }\n      unitPrice\n      availableQuantity\n      currency {\n        image\n        id\n        decimals\n        symbol\n        __typename\n      }\n      asset {\n        chainId\n        collectionAddress\n        tokenId\n        collection {\n          chainId\n          address\n          name\n          standard\n          __typename\n        }\n        name\n        image\n        imageMimetype\n        animationUrl\n        animationMimetype\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}"
}

The query should not be executed if the offerIds is an empty array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions