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

What is the proposed use of the cockpit "layout" features? #3

Open
loremipson opened this issue Dec 3, 2018 · 8 comments
Open

What is the proposed use of the cockpit "layout" features? #3

loremipson opened this issue Dec 3, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@loremipson
Copy link

Preface: I'm brand spanking new to cockpit, and have only been playing around with it for a few hours. My use-case on the front end is Gatsby V2.

When looking at the graphql queries for layout field types, this gets a bit tricky. Because we don't really know what the data structure will be, since the content pieces are all dynamically entered and could be different for each collection entry.

Curious if there's currently a way to handle this that I don't see in the readme. I imagine something with inline fragments in graphql?

@WhippetsAintDogs
Copy link
Collaborator

WhippetsAintDogs commented Dec 3, 2018

Hi @loremipson , I haven't tried the layout field myself. So naturally, it's not actually supported by the plugin. I'll have a look a this soon, stay tuned (any PR in that regard is also welcome) ☺

@patesson
Copy link

Part of Layout appears to come through already. I haven't tried all the components, but the text based ones work already, returning "'id', 'class', and 'text'. Images return the same but these values don't make sense for the, and I would image any custom components would have similar issues

@DigitalGoldfish
Copy link
Collaborator

I am not sure if you know this article already, It's the best explanation of the Layout field I could find. https://medium.com/@pierreberchtold/gatsby-cockpit-layout-field-e908f4dbd87b

@loremipson
Copy link
Author

Would be great to get that layout parser in this plugin, as it seems gatsby-plugin-cockpit progress has ceased for now.

@DigitalGoldfish
Copy link
Collaborator

It seems to be a pattern with gatsby plugins for cockpit that they get abondoned after a short time gatsby-plugin-cockpit was the third I used and that ceased to be developed. I do hope this one survives ...

Back to the layout field ... as @POGRaphy said, parts of the layout fields are coming through already but the way they are currently added to the graphql schema is a dead end; it wouldn't be possible to write GraphQL queries that match every possible combination that can be in the inferred schema. gatsby-plugin-cockpit uses a GraphQLJson field to return the whole object without gatsby trying to infer a schema for it.
I had a look at the code today and I believe I can migrate it to this plugin without too much effort. I hope to find some time to create a PR over the weekend.

@DigitalGoldfish
Copy link
Collaborator

As promised - experimental support for the layout field type can be found in #14. It would be awesome if one of you can spend some time and test it.

@DigitalGoldfish DigitalGoldfish added this to the Feature complete milestone Jan 20, 2019
@DigitalGoldfish DigitalGoldfish added the enhancement New feature or request label Jan 20, 2019
@DigitalGoldfish DigitalGoldfish self-assigned this Jan 20, 2019
@WhippetsAintDogs
Copy link
Collaborator

Support for Layout and Layout-grid added in version 1.0.14+. Closing this issue.

@WhippetsAintDogs
Copy link
Collaborator

Reopened this issue in order to add support for images and assets nested in Layout and Layout-grid field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants