vogelino / hidden-perspectives-app

The Frontend App of the US-IRAN project
https://hidden-perspectives.now.sh
MIT License
1 stars 1 forks source link

Create Search #24

Closed vogelino closed 5 years ago

vogelino commented 5 years ago

search_view

vogelino commented 5 years ago

Here is the graphcool query we should use for the search:

query Search($searchQuery: String!) {
  allEvents(
    filter: {
      OR: [
        { eventTitle_contains: $searchQuery }
        { eventDescription_contains: $searchQuery }
        { eventStakeholders_some: {
          stakeholderFullName_contains: $searchQuery
        } }
      ]
    }
    orderBy: eventStartDate_ASC
  ) {
    id
    eventTitle
  }
  allDocuments(
    filter: {
      OR: [
        { documentTitle_contains: $searchQuery }
        { documentDescription_contains: $searchQuery }
        { mentionedStakeholders_some: {
          stakeholderFullName_contains: $searchQuery
        } }
      ]
    }
    orderBy: documentCreationDate_ASC
  ) {
    id
    documentTitle
  }
  allStakeholders(
    filter: {
      OR: [
        { stakeholderFullName_contains: $searchQuery }
        { stakeholderDescription_contains: $searchQuery }
      ]
    }
    orderBy: stakeholderFullName_ASC
  ) {
    id
    stakeholderFullName
  }
}
vogelino commented 5 years ago

The pull request #35 is ready to be reviewed @flozia.