api-extensions.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import gql from 'graphql-tag';
  2. export const adminApiExtensions = gql`
  3. type GlobalSearchResultItem {
  4. id: ID!
  5. name: String!
  6. data: JSON
  7. entityType: String!
  8. entityId: ID!
  9. entityCreatedAt: DateTime!
  10. entityUpdatedAt: DateTime!
  11. languageCode: LanguageCode!
  12. }
  13. type GlobalSearchResult {
  14. items: [GlobalSearchResultItem!]!
  15. totalItems: Int!
  16. }
  17. enum GlobalSearchSortField {
  18. id
  19. name
  20. entityCreatedAt
  21. entityUpdatedAt
  22. }
  23. enum GlobalSearchSortDirection {
  24. ASC
  25. DESC
  26. }
  27. input GlobalSearchInput {
  28. query: String
  29. enabledOnly: Boolean
  30. entityTypes: [String!]
  31. sortField: GlobalSearchSortField
  32. sortDirection: GlobalSearchSortDirection
  33. take: Int
  34. skip: Int
  35. }
  36. extend type Query {
  37. globalSearch(input: GlobalSearchInput!): GlobalSearchResult!
  38. globalSearchIndexableEntities: [String!]!
  39. }
  40. extend type Mutation {
  41. triggerGlobalSearchBuildIndex: Boolean!
  42. triggerGlobalSearchRebuildIndex: Boolean!
  43. }
  44. `;