Builder.io preview is not updating until i publish changes

I build a “dynamic” navigation for which i can define the links in builder.io,
(see below for the complete code),
but when i edit the data in builder.io, the preview does not update until i publish and reload.

Builder content link

Builder public api key
2e78205c84e742f38c54bf8bcf540cf9

What are you trying to accomplish
live edit / visually edit navigation links

Screenshots or video link
https://streamable.com/0lsdh0

Code stack you are integrating Builder with
Qwik

Reproducible code example

import { Resource, component$, useResource$ } from "@builder.io/qwik";
import { getAllContent } from "@builder.io/sdk-qwik";
import { NavLink } from "../nav-link/nav-link";

interface LinkDocument {
  data: {
    label: {
      Default: string;
    };
    href: {
      Default: string;
    };
    order: number;
  };
}

interface Props {
  linkModel: string;
}
export const DynamicLinkList = component$((props: Props) => {
  const linksResource = useResource$(() =>
    getAllContent({
      model: props.linkModel,
      apiKey: import.meta.env.PUBLIC_BUILDER_API_KEY,
    }).then((links) => {
      (links as {results: LinkDocument[]}).results.sort((a, b) => a.data.order - b.data.order);
      return links;
    }),
  );

  return (
    <Resource
      value={linksResource}
      onPending={() => <>Loading...</>}
      onRejected={(error) => <>Error: {error.message}</>}
      onResolved={(links) => (
        <ul>
          {(links as {results: LinkDocument[]}).results.map((link) => (
            <li
              key={`link-${link.data.href.Default}-${link.data.label.Default}`}
            >
              <NavLink href={link.data.href.Default} activeClass="active">
                {link.data.label.Default}
              </NavLink>
            </li>
          ))}
        </ul>
      )}
    />
  );
});

Hello @UAV-Painkillers,

Can you try using the option includeUnpublished: true and see if that helps

Example:

type Model = 'page'

const getBuilderContent = async (model: Model, url: URL) => {
  return fetchOneEntry({
    model,
    apiKey: import.meta.env.PUBLIC_BUILDER_API_KEY,
    options: getBuilderSearchParams(url.searchParams),
    userAttributes: {
      urlPath: url.pathname, 
    },
    includeUnpublished: true, // Add this
  })
}

Thanks for the quick reply,

sadly it does not help,
the builder.io editor still shows the old data even when changing the fields, only when hitting the refresh button, the visual preview gets updated.

also i would not like to include the includeUnpublished property in a production build as this would mean that users could see non-published content.