0.0.7 • Published 6 years ago
gatsby-source-newsapi v0.0.7
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
}
}
}
}