Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
gatsby-source-github-api
Advanced tools
Readme
Source plugin for pulling data into Gatsby from the official GitHub v4 GraphQL API.
npm i gatsby-source-github-api
Follow GitHub's guide how to generate a token.
Once you are done, either create a gatsby-config.js
file or open the one you already have.
In there, you want to add this plugin and at least add the token in the options object:
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-github-api`,
options: {
// url: API URL to use. Defaults to https://api.github.com/graphql
url: someUrl,
// token: required by the GitHub API
token: someString,
// GraphQLquery: defaults to a search query
graphQLQuery: anotherString,
// variables: defaults to variables needed for a search query
variables: someObject
}
}
];
Search query:
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-github-api`,
options: {
token: "hunter2",
variables: {
q: "author:ldd state:closed type:pr sort:comments",
nFirst: 2
}
}
}
];
resulting API call:
query ($nFirst: Int, $q: String) {
search(query: "${q}", type: ISSUE, first: ${nFirst}){
edges{
node{
... on PullRequest{
title
}
}
}
}
}
Custom GraphQL query:
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-github-api`,
options: {
token: "hunter2",
variables: {},
graphQLQuery: `
query {
repository(owner:"torvalds",name:"linux"){
description
}
}
`
}
}
];
resulting API call:
query {
repository(owner: "torvalds", name: "linux") {
description
}
}
For more examples see gatsby-starter-github-portfolio.
You'll probably want to use valid GraphQL queries. To help you, GitHub has a Query Explorer with auto-completion.
v1.0.0
add support for gatsby v3. Remove support for older versions of gatsbyv0.2.1
update dependenciesv0.2.0
provide raw github responsev0.1.5
document url option (for GitHub Enterprise users)v0.1.4
v0.1.3
gatsby-transformer-json
v0.1.2
Updated yarn.lock
to address github security warningsv0.1.1
Updated Readme for easier usagev0.1.0
Submit to Gatsby's Plugin Libraryv0.0.4
Update dev dependencies, add linting script to package.jsonv0.0.3
Initial public releaseFAQs
gatsby plugin for github v4 API
The npm package gatsby-source-github-api receives a total of 599 weekly downloads. As such, gatsby-source-github-api popularity was classified as not popular.
We found that gatsby-source-github-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.