mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
- 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
30 lines
495 B
JavaScript
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|