-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgatsby-node.js
44 lines (38 loc) · 1.05 KB
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.org/docs/node-apis/
*/
// You can delete this file if you're not using it
// note we do use https://www.gatsbyjs.org/packages/gatsby-plugin-create-client-paths/
// for more info read https://www.gatsbyjs.org/docs/authentication-tutorial/#creating-client-only-routes
const path = require(`path`)
exports.createPages = async ({ actions, graphql }) => {
const { createPage } = actions
const { data } = await graphql(`
query {
github {
organization(login: "FullstackAcademy") {
team(slug: "1904-fsa-ny") {
members(first: 53) {
edges {
node {
login
}
}
}
}
}
}
}
`)
data.github.organization.team.members.edges.forEach(({ node }) => {
createPage({
path: `resumes/${node.login}`,
component: path.resolve(`./src/templates/UserPageGh.js`),
context: {
username: node.login,
},
})
})
}