Skip to content

Optimize Compiled binary size #102

@thangpqgm

Description

@thangpqgm

Shopify sets a limit for Compiled binary size of 256 kb, and I'm having trouble because I haven't put a single line of code in and the Compiled binary size is already 155kb.
Below is the content of my run.graphql file.

query Input {
  cart {
    lines {
      id
      attribute(key: "_my_key") {
        key
        value
      }
      cost {
        amountPerQuantity {
          amount
        }
      }
      quantity
      merchandise {
        __typename
        ... on ProductVariant {
          id
          product {
            id
          }
        }
      }
    }
  }
  discountNode {
    metafield(namespace: "$app:function", key: "function-configuration") {
      value
    }
  }
}

I have done measurements and found that with just 3 lines

 cost {
        amountPerQuantity {
          amount
        }
      }

it has increased 40kb,

Please provide a solution or guide me to solve this, I have a list of functions that need to be implemented and "40kb" took up 50% of what I wrote.
Thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions