change size to first in query param

This commit is contained in:
Hongbo Wu
2022-07-13 10:46:03 +08:00
parent 931c519d44
commit 970609c3b8
4 changed files with 6 additions and 6 deletions

View File

@ -1353,8 +1353,8 @@ export type QuerySubscriptionsArgs = {
export type QueryTypeaheadSearchArgs = {
first?: InputMaybe<Scalars['Int']>;
query: Scalars['String'];
size?: InputMaybe<Scalars['Int']>;
};

View File

@ -924,7 +924,7 @@ type Query {
sendInstallInstructions: SendInstallInstructionsResult!
sharedArticle(selectedHighlightId: String, slug: String!, username: String!): SharedArticleResult!
subscriptions(sort: SortParams): SubscriptionsResult!
typeaheadSearch(query: String!, size: Int): TypeaheadSearchResult!
typeaheadSearch(first: Int, query: String!): TypeaheadSearchResult!
user(userId: ID, username: String): UserResult!
users: UsersResult!
validateUsername(username: String!): Boolean!

View File

@ -899,7 +899,7 @@ export const typeaheadSearchResolver = authorized<
TypeaheadSearchSuccess,
TypeaheadSearchError,
QueryTypeaheadSearchArgs
>(async (_obj, { query, size }, { claims }) => {
>(async (_obj, { query, first }, { claims }) => {
if (!claims?.uid) {
return { errorCodes: [TypeaheadSearchErrorCode.Unauthorized] }
}
@ -910,9 +910,9 @@ export const typeaheadSearchResolver = authorized<
properties: {
env: env.server.apiEnv,
query,
size,
first,
},
})
return { items: await searchAsYouType(claims.uid, query, size || undefined) }
return { items: await searchAsYouType(claims.uid, query, first || undefined) }
})

View File

@ -1896,7 +1896,7 @@ const schema = gql`
webhooks: WebhooksResult!
webhook(id: ID!): WebhookResult!
apiKeys: ApiKeysResult!
typeaheadSearch(query: String!, size: Int): TypeaheadSearchResult!
typeaheadSearch(query: String!, first: Int): TypeaheadSearchResult!
}
`