Rename findResources to searchResults

This commit is contained in:
mattwr18 2020-03-18 19:45:48 +01:00
parent 79fbdd7734
commit 627b47837e
4 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@ export default shield(
'*': deny,
findPosts: allow,
findUsers: allow,
findResources: allow,
searchResults: allow,
embed: allow,
Category: allow,
Tag: allow,

View File

@ -2,7 +2,7 @@ import log from './helpers/databaseLogger'
export default {
Query: {
findResources: async (_parent, args, context, _resolveInfo) => {
searchResults: async (_parent, args, context, _resolveInfo) => {
const { query, limit } = args
const { id: thisUserId } = context.user
// see http://lucene.apache.org/core/8_3_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description

View File

@ -1,5 +1,5 @@
union SearchResult = Post | User
type Query {
findResources(query: String!, limit: Int = 5): [SearchResult]!
searchResults(query: String!, limit: Int = 5): [SearchResult]!
}

View File

@ -1,13 +1,13 @@
import gql from 'graphql-tag'
import { userFragment, postFragment, tagsCategoriesAndPinnedFragment } from './Fragments'
export const findResourcesQuery = gql`
export const searchQuery = gql`
${userFragment}
${postFragment}
${tagsCategoriesAndPinnedFragment}
query($query: String!, $limit: Int = 5) {
findResources(query: $query, limit: $limit) {
searchResults(query: $query, limit: $limit) {
__typename
... on Post {
...post