Why is fetching something like blog data, and making it available in my react module so hard? Hoping someone can help me out.
Come context: I have a react module called BlogList, where the user can select 3 blog entries in the CMS. My fields are defined like this:
export const fields = (
<ModuleFields>
<RepeatedFieldGroup
label="Articles"
name="blogList"
occurrence={{
min: 1,
max: 3,
default: 1,
}}
default={[{ blog: "220084922864" }, { blog: "220462218717" }]}
>
<BlogField
name="blog"
label="Blog"
required={false}
locked={false}
default={220084922864}
/>
</RepeatedFieldGroup>
</ModuleFields>
);
My field definition in my module looks like this:{
blogList: { blog: string }[];
};
Great so far. Now, how on earth do I get some useful information about the blogs into my React Module.
At first I considered GraphQL but I see no way to make that happen, as I can not easily pass the blog Ids to a graphql variable.
Maybe I can use some huble voodoo, via the hublDataTemplate, but that is so painful to devleop, debug and test that after starting to question life decisions I moved on.
So, now I'm thinking I might need to call the hubspot API via getServerProps, but before I waste another afternoon, there must be something I am missing? It can't be this hard?
Thanks for any help :)