The frontmatter cannot handle an array of objects, and seems to call toString() on the object somewhere
add a frontmatter like this
authors:
- name: foo
avatar: ../../path
page: /path/to/page
- name: bar
avatar: ../../path2
page: /path/to/page
and print it to the console to see this
authors:Array(2)
0:"[object Object]"
1:"[object Object]"
I would expect to see my array of objects in the frontmatter
I get the string representation of the object
npm list gatsby): 1.9.250gatsby --version): 1.9.260gatsby-config.js: N/A
package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A
Where are you printing to the console?
I am printing to the console in the render method of the page/component
that queries the front matter.
Someone in discord mentioned that they think it might be due to not quoting
the strings in the front matter but I haven't had a chance to try it out yet
On Fri, 11 May 2018, 3:28 pm Kyle Mathews, notifications@github.com wrote:
Where are you printing to the console?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/5372#issuecomment-388273311,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AI_NQAnbFurOm5_7WDS_mLm_h-CKf3O6ks5txS-jgaJpZM4T67Iq
.
I'm not seeing this when trying to reproduce :/
hmm yes you are right, I am not sure what was causing the string representation, but a server restart seemed to fix it. Sorry my mistake
If you starter develop when you had array of string in author field gatsby would create schema as array of strings and changing those strings to objects while develop is running won't cause schema to update (Gatsby just doesn't update schema while it's running). I will be looking to add schema updates in future.
ahh that is indeed what happened
Most helpful comment
If you starter
developwhen you had array of string in author field gatsby would create schema as array of strings and changing those strings to objects whiledevelopis running won't cause schema to update (Gatsby just doesn't update schema while it's running). I will be looking to add schema updates in future.