Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Pages from GraphQL queries #4910

Closed
zoosky opened this issue Jul 7, 2018 · 6 comments
Closed

Create Pages from GraphQL queries #4910

zoosky opened this issue Jul 7, 2018 · 6 comments

Comments

@zoosky
Copy link

zoosky commented Jul 7, 2018

This would Hugo enable to adapt to an API based Headless CMS.

Context:

"Pages from “other data sources”
Currently, in addition to Hugo’s list pages, every URL must be backed by a content file (Markdown, HTML etc.). This covers most use cases, but we need a flexible way to generate pages from other data sources. Think product catalogues and similar."

See http://gohugo.io/news/lets-celebrate-hugos-5th-birthday/

@lucperkins
Copy link

lucperkins commented Jul 12, 2018

I'm not necessarily opposed to a feature like this, but to me it seems like it would be very difficult to manage the trade-off between power and simplicity. Allowing users to specify a GraphQL query via configuration might be simple enough, but then where do the fetched pages end up in the directory structure? How often does the fetching happen? How would authentication for GraphCMS/Contentful/whatever be handled?

Right now the "Hugo Way" is to make gathering inputs a process that happens outside of Hugo, with the exception of things like readFile and readJSON, both of which are much more specific and limited in scope than what you're calling for.

I'm not saying that a GraphQL implementation is impossible per se. I'm just skeptical that there's enough similarity across GraphQL content backends to make a feature like this generally useful. It seems more likely to me that users would end up needing to roll their own content gathering solutions anyway.

@lucperkins
Copy link

lucperkins commented Jul 12, 2018

In a different mood, what would be super cool would be some kind of API standard for GraphQL content gathering, a standard to which existing GraphQL content providers could be pressured to conform. This would provide a solid "contractual" basis for tools like Hugo, Gatsby, Jekyll, Middleman, and the like to provide their own GraphQL implementations. The standard could cover auth*, directory organization, file metadata, etc. Not gonna hold my breath, though!

@zoosky
Copy link
Author

zoosky commented Aug 14, 2018

@regisphilibert
Copy link
Member

Hopefully this would fall under #5074

@bep
Copy link
Member

bep commented Nov 2, 2018

Duplicates #5074 (kind of)

@bep bep added the Duplicate label Nov 2, 2018
@bep bep closed this as completed Nov 2, 2018
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants