Skip to content

Commit 7eac690

Browse files
authored
fix: duplicate speakers (graphql#1527)
1 parent 29ff688 commit 7eac690

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

gatsby-node.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,16 @@ export const createPages: GatsbyNode["createPages"] = async ({
155155
)
156156

157157
// Fetch full info of each speaker individually and concurrently
158-
const speakers: SchedSpeaker[] = await Promise.all(
159-
usernames.map(async user => {
160-
await new Promise(resolve => setTimeout(resolve, 2000)) // 2 second delay between requests, rate limit is 30req/min
161-
return fetchData(
162-
`https://graphqlconf23.sched.com/api/user/get?api_key=${schedAccessToken}&by=username&term=${user.username}&format=json&fields=username,company,position,name,about,location,url,avatar,role,socialurls`
163-
)
164-
})
165-
)
158+
const speakers = (
159+
(await Promise.all(
160+
usernames.map(async user => {
161+
await new Promise(resolve => setTimeout(resolve, 2000)) // 2 second delay between requests, rate limit is 30req/min
162+
return fetchData(
163+
`https://graphqlconf23.sched.com/api/user/get?api_key=${schedAccessToken}&by=username&term=${user.username}&format=json&fields=username,company,position,name,about,location,url,avatar,role,socialurls`
164+
)
165+
})
166+
)) as SchedSpeaker[]
167+
).filter(s => s.role.includes("speaker"))
166168

167169
// Create schedule page
168170
createPage({

src/content/community/Community-Events.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ To join, add yourself to an [upcoming meeting agenda](https://github.com/graphql
5454

5555
### GraphQLConf 2023
5656

57-
* **Date:** September 19-21, 2023
58-
* **Location:** San Francisco Bay Area, CA
59-
* **Host:** GraphQL Foundation
60-
* [**Registration**](https://graphql.org/conf/#attend)
61-
* [**Schedule**](https://graphql.org/conf/schedule/)
62-
* [**Code of Conduct**](https://graphql.org/conf/faq/#codeofconduct)
63-
57+
- **Date:** September 19-21, 2023
58+
- **Location:** San Francisco Bay Area, CA
59+
- **Host:** GraphQL Foundation
60+
- [**Registration**](https://graphql.org/conf/#attend)
61+
- [**Schedule**](https://graphql.org/conf/schedule/)
62+
- [**Code of Conduct**](https://graphql.org/conf/faq/#codeofconduct)
6463

6564
## Meetups
6665

src/templates/speakers.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ const SpeakersTemplate: FC<PageProps<{}, { speakers: SchedSpeaker[] }>> = ({
1818
// create an array for keynote speakers in fetched data maintaining the order in keynoteSpeakers
1919
const keynoteSpeakersData = keynoteNames
2020
.map(name => {
21-
return speakersData.find(
22-
(speaker: any) =>
23-
speaker.name === name && speaker.role.includes("speaker")
24-
)
21+
return speakersData.find((speaker: any) => speaker.name === name)
2522
})
2623
.filter(Boolean) as SchedSpeaker[]
2724

2825
const otherSpeakersData = speakersData.filter(
29-
(speaker: any) =>
30-
speaker.role.includes("speaker") && !keynoteNames.includes(speaker.name)
26+
(speaker: any) => !keynoteNames.includes(speaker.name)
3127
)
3228

3329
// Sort other speakers by last name alphabetically

0 commit comments

Comments
 (0)