We have a fuxt-backend based server that is only used to generate mock data. That data is then exported into a JSON file that is in fuxt at /stories/mock-api.json.
I encourage you to open the file in your browser and see how the data is shaped. If you look at it in Firefox’s DevTools network tab, it’s easier to browse.
Access mock-api.json in your story
import BlockWork from "~/components/block/work"
import { data as API } from "~/stories/mock-api.json"
export default {
title: "Project name / BlockWork",
}
export const Default = () => ({
components: { BlockWork },
data() {
return {
API, // This loads the mock API into the template for use below
}
},
template: `<block-work :image="API.images.nodes[0]"/>`,
})