-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Output JSON Object wrapped in Array #1877
Comments
Definitely a need, could have sworn we had an issue for this. |
I wish we could use json data sets as I need one for fullCalendar events as a json data set not just a json file. Figured it out with: |
@gil-- I think I misread this initially - you can use the list widget for this, defining fields just as you currently do with the object widget. |
Hmm not sure what I was thinking on Feb 5, this is definitely not possible. We essentially need
I still think this issue is a dupe, just can't find the original. Ah well. Adding to radar. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Finally found it - this is a duplicate of #531, please track there. |
Is it possible to somehow output the JSON object in an array? I tried doing that manually but the array wrapper is removed upon saving fields.
Currently:
However, I'm using Netlify-CMS with Gatsby and I'm trying to Query the JSON using
gatsby-transformer-json
but it seems it requires arrays or strings and not an object. If I wrap the Netlify outputted object in an array it works:That does the trick but the array wrapper
[]
is removed on every save. Without the array wrapper, showBreadcrumbs and showSocialSharing are not query-able:Has anyone tried to import JSON into gatsby before and had better luck? I basically need array instead of key-value.
I ended up querying allFile which allows me to filter on a specific file name such as products.json but it's definitely not ideal. Would prefer just wrapping JSON object in an array for a more simplified graphql query.
The text was updated successfully, but these errors were encountered: