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

[gatsby-plugin-feed] Document slug fields creation #3873

Closed
wants to merge 1 commit into from
Closed

[gatsby-plugin-feed] Document slug fields creation #3873

wants to merge 1 commit into from

Conversation

jiahaog
Copy link
Contributor

@jiahaog jiahaog commented Feb 6, 2018

I noticed that without configuration to create the slug fields, it will result in the following error:

error Plugin gatsby-plugin-feed returned an error


  Error: GraphQLError: Cannot query field "fields" on type "  MarkdownRemark".

  - internals.js:29
    [jiahaog.com]/[gatsby-plugin-feed]/internals.js:29:13

  - es6-promise.js:409 tryCatch
    [jiahaog.com]/[es6-promise]/dist/es6-promise.js:409:12

  - es6-promise.js:424 invokeCallback
    [jiahaog.com]/[es6-promise]/dist/es6-promise.js:424:13

  - es6-promise.js:176
    [jiahaog.com]/[es6-promise]/dist/es6-promise.js:176:14

  - es6-promise.js:128 flush
    [jiahaog.com]/[es6-promise]/dist/es6-promise.js:128:5

  - next_tick.js:131 _combinedTickCallback
    internal/process/next_tick.js:131:7

  - next_tick.js:180 process._tickCallback
    internal/process/next_tick.js:180:9

This has already been implemented in gatsbyjs/gatsby-starter-blog#70 but it's not immediately obvious when starting afresh on a new project, so I just copied the implementation over to the docs.

Cheers!

@gatsbybot
Copy link
Collaborator

Deploy preview for gatsbygram ready!

Built with commit 8dee196

https://deploy-preview-3873--gatsbygram.netlify.com

jiahaog added a commit to jiahaog/jiahao.codes that referenced this pull request Feb 6, 2018
@CrowsVeldt
Copy link

I just wanted to throw in my two cents, please let me know if this is out of place. I ran into this exact problem today, trying to add an RSS feed to my site. I'm still fairly new at this, and I found looking for the solution to be frustrating. Especially as the docs say that it should just work. A few months ago I probably would have just lost motivation and given up.

I did find the solution, and considered making a pull request myself to update the docs, but then I found this one. I hope this can get merged in quickly to hopefully prevent discouraging other beginners like myself.

@jiahaog
Copy link
Contributor Author

jiahaog commented Feb 21, 2018

@KyleAMathews is this okay to be merged? 😄

@jiahaog
Copy link
Contributor Author

jiahaog commented Feb 21, 2018

Or perhaps the accompanying logic should be moved into the gatsby-plugin-feed directly, I can try to change that

@KyleAMathews
Copy link
Contributor

Oh sorry, forgot to reply to this. I hestitated to do anything here because @mikefowler has a WIP PR that fixes this another, better way #3413

Could you look through that PR/discussion and try helping it along?

gatsby-plugin-feed shouldn't require that slug exists so we should solve that directly instead of documenting it. Slug isn't a universal way of storing the page path.

@jiahaog jiahaog deleted the patch-2 branch February 26, 2018 09:24
@jiahaog
Copy link
Contributor Author

jiahaog commented Feb 26, 2018

Ah okay, I'll check it out then 👍

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

Successfully merging this pull request may close these issues.

4 participants