gatsby-source-newsapi

0.0.7 • Public • Published

gatsby-source-newsapi

Source plugin for pulling data into Gatsby from NewsAPI.

Install

npm i --save gatsby-source-newsapi

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-source-newsapi`,
    options: {
      apiKey: `YOUR_NEWSAPI_KEY_HERE`,
    },
  },
];

How to query

Get the Top Headlines

{
  allNewsApiTopHeadlines {
    edges {
      node {
        source {
          id
          name
        }
        title
        author
        description
        url
        urlToImage
        publishedAt
      }
    }
  }
}

Package Sidebar

Install

npm i gatsby-source-newsapi

Weekly Downloads

0

Version

0.0.7

License

MIT

Unpacked Size

6.36 kB

Total Files

9

Last publish

Collaborators

  • thomann061