Skip to content

Source plugin for pulling data into Gatsby from NewsAPI.

Notifications You must be signed in to change notification settings

thomann061/gatsby-source-newsapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
      }
    }
  }
}

About

Source plugin for pulling data into Gatsby from NewsAPI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published