Skip to content

Commit

Permalink
chore/fix-lint-ci (#520)
Browse files Browse the repository at this point in the history
chore: fix lint ci
  • Loading branch information
c3b5aw authored Oct 1, 2023
1 parent 91ee93c commit 97ac580
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 25 deletions.
12 changes: 1 addition & 11 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,5 @@
"parser": "typescript",
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrderParserPlugins": [
"jsx",
"typescript",
"importOrderParserPlugins",
"classProperties",
"decorators-legacy"
]
"trailingComma": "all"
}
28 changes: 14 additions & 14 deletions packages/plugins/character-limit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ export const characterLimitDefaultOptions: Required<CharacterLimitOptions> = {

/* CharacterLimitPlugin Supports Apollo Server v3 and ver4 */
export const ApolloServerCharacterLimitPlugin = function (maxLength: number): any {
return {
requestDidStart (requestContext: any): Promise<any>| undefined {
const { request } = requestContext;
return {
requestDidStart(requestContext: any): Promise<any> | undefined {
const { request } = requestContext;

if (!request?.query) {
return;
}
const queryLength = request.query.length;
if (!request?.query) {
return;
}
const queryLength = request.query.length;

if (queryLength > maxLength) {
throw new GraphQLError(`Query exceeds our maximum allowed length`, {
extensions: { code: 'BAD_USER_INPUT' }
});
}
}
};
if (queryLength > maxLength) {
throw new GraphQLError(`Query exceeds our maximum allowed length`, {
extensions: { code: 'BAD_USER_INPUT' },
});
}
},
};
};

export const characterLimitPlugin = (options?: CharacterLimitOptions): Plugin => {
Expand Down

0 comments on commit 97ac580

Please sign in to comment.