Enonic version: 7.8
OS: MacOS
Hey!
I’m trying to fetch a pictures absolute url from the cms via graphQL from the next.xp app by its content id.
The query that I’m trying to use works correctly when invoked in the Playground
{
guillotine {
get(
key: "c4b38a24-7857-4a56-bf92-a6bc17369a15") {
displayName
... on media_Image {
mediaUrl(
type: absolute
)
}
}
}
}
But goes to error with
Error: Error serializing `.common` returned from `getServerSideProps` in "/[[...contentPath]]".
Reason: `object` ("[object Error]") cannot be serialized as JSON. Please only return JSON serializable data types.
When invoked from the next app as follows:
Part.tsx:
query($path:ID!){
guillotine {
get(key:"c4b38a24-7857-4a56-bf92-a6bc17369a15") {
displayName
... on media_Image {
mediaUrl(
type: absolute
)
}
}
}
};
Additionally, the first query mentioned in the starters documentation Getting to know the API - Enonic Developer Portal produces a different result as well when invoked from the next app versus from the Playground.
I wasn’t able to figure out the difference what the execution context causes, can you point me to the right documents for that?