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

Add gatsby-plugin-feed #68

Merged
merged 1 commit into from
Nov 13, 2017
Merged

Add gatsby-plugin-feed #68

merged 1 commit into from
Nov 13, 2017

Conversation

mathiasbynens
Copy link
Contributor

After seeing https://github.com/gatsbyjs/gatsby-starter-blog/issues/33 I decided to try adding gatsby-plugin-feed to the demo.

However, this error occurs:

$ gatsby build
success delete html files from previous builds — 0.035 s
success open and validate gatsby-config.js — 0.007 s
success copy gatsby files — 0.033 s
success onPreBootstrap — 0.012 s
success source and transform nodes — 0.098 s
success building schema — 0.547 s
success createLayouts — 0.011 s
success createPages — 0.037 s
success createPagesStatefully — 0.014 s
success onPreExtractQueries — 0.002 s
success update schema — 0.177 s
success extract queries from components — 0.144 s
success run graphql queries — 0.065 s
success write out page data — 0.018 s
success write out redirect data — 0.004 s
success onPostBootstrap — 0.004 s

info bootstrap finished - 4.369 s

success Building CSS — 4.740 s
success Building production JavaScript bundles — 14.249 s
success Building static HTML for pages — 3.876 s
error Plugin gatsby-plugin-feed returned an error


  Error: GraphQLError: Argument "filter" has invalid value {frontmatter: {dr  aft: {ne: true}}}.
  In field "frontmatter": In field "draft": Unknown field., GraphQLError: Ca  nnot query field "fields" on type "MarkdownRemark".

  - internals.js:29
    [gatsby-starter-blog]/[gatsby-plugin-feed]/internals.js:29:13

  - es6-promise.js:416 tryCatch
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:416:12

  - es6-promise.js:431 invokeCallback
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:431:13

  - es6-promise.js:177
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:177:16

  - es6-promise.js:126 flush
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:126: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


info Done building in 27.349 sec

Am I doing something silly here?

@KyleAMathews
Copy link
Contributor

Would love to get gatsby-plugin-feed in! I'd thought a few times about adding it but haven't gotten around to it.

gatsby-plugin-feed includes a default query that doesn't work for all sites. You'll need to follow its instructions about how to override its default query.

Another option is to remove what's failing in the default query — the draft filter part. @nicholaswyoung what do you think about making the default query in gatsby-plugin-feed less opinionated so it works out of the box more often?

@secretfader
Copy link

@KyleAMathews I recall that we discussed this earlier, and came to a conclusion. But now that I'm reconsidering, I think we may be better off removing the query restriction but add a mention to the docs.

Is that a fair compromise between power and ease of use?

@KyleAMathews
Copy link
Contributor

Is that a fair compromise between power and ease of use?

Yeah! I think in general we should make sure people have as good as possible experience the first time they try something and let them customize it as necessary.

@mathiasbynens
Copy link
Contributor Author

I agree with the above sentiment. Rather than making this demo more complicated, it’d be better to change gatsby-plugin-feed’s defaults so they work out-of-the-box in more scenarios.

@mathiasbynens
Copy link
Contributor Author

With the updated version of the plugin, there’s a new error:

error Plugin gatsby-plugin-feed returned an error


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

  - internals.js:29
    [gatsby-starter-blog]/[gatsby-plugin-feed]/internals.js:29:13

  - es6-promise.js:416 tryCatch
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:416:12

  - es6-promise.js:431 invokeCallback
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:431:13

  - es6-promise.js:177
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:177:16

  - es6-promise.js:126 flush
    [gatsby-starter-blog]/[es6-promise]/dist/es6-promise.js:126: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


info Done building in 18.02 sec

@mathiasbynens
Copy link
Contributor Author

@nicholaswyoung Is this another thing that should be changed in the plugin itself vs. in this example’s config?

@secretfader
Copy link

secretfader commented Nov 12, 2017

@mathiasbynens I'm not 100% sure what's going on with the error above, but I don't think it's the plugin.

Update: This starter needs to create slug which is a field on the fields object, introduced as a placeholder for optional fields in 1.0.

Here's the appropriate documentation on Node APIs and boundActionCreators.

I'll PR these fixes later today, after which the plugin should generate cleanly with defaults.

@KyleAMathews
Copy link
Contributor

@mathiasbynens check things out again — just merged @nicholaswyoung's PR

@mathiasbynens
Copy link
Contributor Author

Seems to be working now! Thanks, everyone :)

@mathiasbynens mathiasbynens changed the title [WIP] Add gatsby-plugin-feed Add gatsby-plugin-feed Nov 13, 2017
@KyleAMathews KyleAMathews merged commit 53c2902 into gatsbyjs:master Nov 13, 2017
@KyleAMathews
Copy link
Contributor

Thanks @mathiasbynens and @nicholaswyoung for working to get feed support added!

@mathiasbynens mathiasbynens deleted the rss branch November 14, 2017 21:08
restato pushed a commit to restato/gatsby-starter-blog that referenced this pull request Jun 30, 2019
* RSS post summary use "spoiler" graphql field

* Update gatsby-config.js
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.

3 participants