Skip to content

Commit

Permalink
fix admin search (#15)
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Funkhouser <147884153+golanglemonade@users.noreply.github.com>
  • Loading branch information
golanglemonade authored Sep 10, 2024
1 parent 93c986e commit 0144539
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions genhooks/templates/search/graph.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ extend type Query{
"""
query: String!
): SearchResultConnection
"""
Admin search across all objects
"""
adminSearch(
"""
Search query
"""
query: String!
): SearchResultConnection
}
{{ range $object := $.Objects }}
type {{ $object.Name }}SearchResult {
Expand Down
4 changes: 4 additions & 0 deletions genhooks/templates/search/query.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
query {{ $.Name }}Search($query: String!) {
{{- if eq $.Name "Admin" }}
adminSearch(query: $query) {
{{- else }}
search(query: $query) {
{{- end }}
nodes {
{{- range $object := $.Objects }}
... on {{ $object.Name | toUpperCamel }}SearchResult {
Expand Down

0 comments on commit 0144539

Please sign in to comment.