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

Do not execute FetchCartItems if there is no item #592

Open
NicolasMahe opened this issue May 8, 2024 · 0 comments
Open

Do not execute FetchCartItems if there is no item #592

NicolasMahe opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@NicolasMahe
Copy link
Member

NicolasMahe commented May 8, 2024

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.

@NicolasMahe NicolasMahe added the bug Something isn't working label May 8, 2024
@ismailToyran ismailToyran removed their assignment Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants