mattwr18 ebc5cf392d Fix search by adding result id
- Apollo cache requires an id to commit to their store
- add id to each query result
- refactor out the store
- still can use a lot of refactoring
2019-12-13 12:30:00 +01:00

30 lines
495 B
JavaScript

import gql from 'graphql-tag'
export const findResourcesQuery = gql`
query($query: String!) {
findResources(query: $query, limit: 5) {
id
searchResults {
__typename
... on Post {
id
title
slug
commentsCount
shoutedCount
createdAt
author {
name
}
}
... on User {
id
name
slug
avatar
}
}
}
}
`