Skip to content

Commit

Permalink
feat: add venue to team node (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Pope authored Dec 26, 2019
1 parent 07c5b89 commit 411f094
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/createSchemaCustomization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const createSchemaCustomization = ({ actions }: NodePluginArgs) => {
type NHLVenue implements Node {
team: NHLTeam @link
}
type NHLTeam implements Node {
venue: NHLVenue @link
}
`);

return null;
Expand Down
1 change: 1 addition & 0 deletions src/nodes/build-team-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const buildTeamNodes = (
shortName: team.shortName,
officialSiteUrl: team.officialSiteUrl,
active: team.active,
venue: createNodeId(team.venue.name),
slug: slugify(team.name, { lower: true }),
images: {
logo: {
Expand Down
4 changes: 4 additions & 0 deletions tests/__snapshots__/createSchemaCustomization.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ exports[`createSchemaCustomization calls #createTypes with the relational schema
type NHLVenue implements Node {
team: NHLTeam @link
}
type NHLTeam implements Node {
venue: NHLVenue @link
}
",
],
],
Expand Down
1 change: 1 addition & 0 deletions tests/nodes/build-team-nodes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ describe('buildTeamNodes', () => {
officialSiteUrl: expect.any(String),
active: expect.any(Boolean),
slug: expect.any(String),
venue: expect.any(String),
images: {
logo: {
primaryLight: expect.any(String),
Expand Down

0 comments on commit 411f094

Please sign in to comment.