1.1.9 • Published 3 years ago

@dadoagency/gatsby-plugin-aa-builder-checkout v1.1.9

Weekly downloads
-
License
0BSD
Repository
-
Last release
3 years ago

This plugin is used to source product data from builder.io and the checkout API.

How To publish:

npm publish --access=public

How this works:

On build: 1. query all the funnel pages that exist 2. query the product selector for each funnel 3. get the list of references to ProductVariant 4. fetch product data from the checkout API for each ProductVariant 5. merge the checkout API data with the builder data to generate a FunnelPageData node with the following shape:

{
    id: "",
    path: "",
    productSelector: {
        onetime: {
            products: [],
            discounts: []
        },
        subscription: {
            products: [],
            discounts: []
        }
    }
}

The funnel page template should have a single page query that queries funnelPageData where path = '$path' to get all the product data for that specific funnel.

We aren't querying allBuilderModels since they don't include refs so instead we query our own data type 'funnelPageData'

Improvement opportunities:

  • use gatsby cache to cache requests in gatsby-node.js to improve build times
  • create graphql fragments to simplify page queries
  • create a distinction between otp and subs products in builder.io
  • do a single request to the checkout API in sourceNodes per page rather than a request per product (checkoutSDK can query a list of products)
1.1.9

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago