-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(SLB-512) Taxonomy filters content hub #391
base: release
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works pretty well already!
I added some suggestions on how to make the select box appear immediately.
@@ -0,0 +1,8 @@ | |||
query ContentHubTerms { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding this one as a static query and injecting it as an executor, the options could be fetched at build time and appear immediately when the page is opened. It should work the same way as the FrameQuery
in layout.tsx
:
silverback-template/apps/website/src/layouts/index.tsx
Lines 13 to 18 in 288a886
const data = useStaticQuery(graphql(FrameQuery)); | |
return ( | |
<OperationExecutorsProvider | |
executors={[ | |
{ executor: drupalExecutor(`/graphql`) }, | |
{ executor: data, id: FrameQuery }, |
@@ -451,6 +501,9 @@ type Query { | |||
|
|||
stringTranslations: [TranslatableString!] | |||
@gatsbyNodes(type: "TranslatableString") | |||
|
|||
contentHubTerms: TermContentHubResults! | |||
@loadByVocabulary(bundle: "content_hub") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the above work, this would have to use @gatsbyNodes
as well, so Gatsby knows about content hub terms.
""" | ||
Content Hub Terms Results from query | ||
""" | ||
type TermContentHubResults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this type required? Couldn't the Query.contentHubTerms
field directly output [TermContentHub]
.
} | ||
|
||
return [ | ||
'total' => count($items), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the other changes are applied, we would also emit just the list of items directly, and no wrapping result opject.
Description of changes
Adding and exposing taxonomy filters onto the content hub.
Motivation and context
To create better filtering for content.
How has this been tested?