ChemPal Documentation - v1.18.0
    Preparing search index...

    Function isShopifyNodesResponse

    • Type guard for a Storefront API nodes(ids:) response. The nodes themselves are not checked: a missing product is null there.

      Parameters

      • response: unknown

        The response to validate

      Returns response is { data: { nodes: unknown[] } }

      Whether the response carries a list of nodes

      isShopifyNodesResponse({ data: { nodes: [null] } }); // true
      isShopifyNodesResponse({ errors: [] }); // false
      export function isShopifyNodesResponse(
      response: unknown,
      ): response is { data: { nodes: unknown[] } } {
      return v.is(shopifyNodesResponseSchema, response);
      }