Add config option to define base URLs for GraphQL view queries #89
Replies: 3 comments
-
I believe there was a reason I didn't add this feature. But I can't quite remember why. I will look into it. |
Beta Was this translation helpful? Give feedback.
-
I took a look at this and there are a couple of things going on. I can add a query MyQuery {
seoMeta(id: "home") {
view {
head(baseUrl: "https://foo.bar")
}
}
} However, this won't have an effect on the URLs of asset fields like To summarize, adding the |
Beta Was this translation helpful? Give feedback.
-
As a side note, I actually already added a comment on the ![]() |
Beta Was this translation helpful? Give feedback.
-
Querying e.g.
seo > view > head
uses the root URL of the statamic application for generating canonical links, which often doesn't make sense for a headless app. The favicon on the other hand seems to be a relative URL, which also breaks on a headless setup. I think it would be nice if there could be config options forapp_url
orfrontend_url
andasset_url
, although Statamic only seems to be using the corresponding ENV varsAPP_URL
andASSET_URL
for CLI tools.Beta Was this translation helpful? Give feedback.
All reactions