Skip to content

Commit

Permalink
chore: Add new frontmatter type to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBaker committed Feb 9, 2023
1 parent 4b9f379 commit ccde47f
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,17 @@ exports.createSchemaCustomization = ({ actions }) => {
translationType: String
dataSource: String
isTutorial: Boolean
signupBanner: SignupBanner
feature: [String]
bug: [String]
security: [String]
ingest: [String]
}
type SignupBanner {
cta: String
url: String
text: String
}
`;

Expand Down Expand Up @@ -388,7 +394,21 @@ exports.createResolvers = ({ createResolvers }) => {
ingest: {
resolve: (source) =>
hasOwnProperty(source, 'ingest') ? source.ingest : null,
}
},
},
SignupBanner: {
cta: {
resolve: (source) =>
hasOwnProperty(source, 'cta') ? source.cta : null,
},
url: {
resolve: (source) =>
hasOwnProperty(source, 'url') ? source.url : null,
},
text: {
resolve: (source) =>
hasOwnProperty(source, 'text') ? source.text : null,
},
},
});
};
Expand Down

0 comments on commit ccde47f

Please sign in to comment.