Skip to content

Commit 20ea160

Browse files
committed
avoid need for change-case
1 parent 757a777 commit 20ea160

File tree

11 files changed

+26
-37
lines changed

11 files changed

+26
-37
lines changed

workspaces/leetcode-api/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"@graphql-codegen/cli": "5.0.2",
3636
"@graphql-codegen/near-operation-file-preset": "3.0.0",
3737
"@types/node": "22.7.4",
38-
"change-case": "5.4.4",
3938
"cross-env": "7.0.3",
4039
"eslint": "9.12.0",
4140
"graphql-query-compress": "1.2.4",

workspaces/leetcode-api/src/api/active-daily-coding-challenge-question/fetchGraphQL.generated.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import type { Simplify } from "type-fest";
44

55
import { getGraphQLClient } from "../../getGraphQLClient.ts";
66

7-
type FetchActiveDailyCodingChallengeQuestionQueryVariables = Types.Exact<{
7+
type ActiveDailyCodingChallengeQuestionQueryVariables = Types.Exact<{
88
[key: string]: never;
99
}>;
1010

11-
type FetchActiveDailyCodingChallengeQuestionQuery = {
11+
type ActiveDailyCodingChallengeQuestionQuery = {
1212
activeDailyCodingChallengeQuestion?: {
1313
date: unknown;
1414
question: {
@@ -21,11 +21,11 @@ type FetchActiveDailyCodingChallengeQuestionQuery = {
2121
};
2222

2323
export type QueryVariables =
24-
Simplify<FetchActiveDailyCodingChallengeQuestionQueryVariables>;
25-
export type Query = Simplify<FetchActiveDailyCodingChallengeQuestionQuery>;
24+
Simplify<ActiveDailyCodingChallengeQuestionQueryVariables>;
25+
export type Query = Simplify<ActiveDailyCodingChallengeQuestionQuery>;
2626

2727
export const QUERY =
28-
"query fetchActiveDailyCodingChallengeQuestion{activeDailyCodingChallengeQuestion{date question{difficulty questionFrontendId title titleSlug}}}";
28+
"query ActiveDailyCodingChallengeQuestion{activeDailyCodingChallengeQuestion{date question{difficulty questionFrontendId title titleSlug}}}";
2929

3030
export function fetchGraphQL(variables: QueryVariables): Promise<Query> {
3131
return getGraphQLClient().request(QUERY, variables);

workspaces/leetcode-api/src/api/active-daily-coding-challenge-question/query.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
query fetchActiveDailyCodingChallengeQuestion {
1+
query ActiveDailyCodingChallengeQuestion {
22
activeDailyCodingChallengeQuestion {
33
date
44
question {

workspaces/leetcode-api/src/api/question-list/fetchGraphQL.generated.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import type { Simplify } from "type-fest";
44

55
import { getGraphQLClient } from "../../getGraphQLClient.ts";
66

7-
type FetchQuestionListQueryVariables = Types.Exact<{
7+
type QuestionListQueryVariables = Types.Exact<{
88
categorySlug: Types.Scalars["String"]["input"];
99
limit?: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
1010
skip?: Types.InputMaybe<Types.Scalars["Int"]["input"]>;
1111
filters: Types.QuestionListFilterInput;
1212
}>;
1313

14-
type FetchQuestionListQuery = {
14+
type QuestionListQuery = {
1515
questionList?: {
1616
totalNum: number;
1717
data: Array<{
@@ -24,11 +24,11 @@ type FetchQuestionListQuery = {
2424
} | null;
2525
};
2626

27-
export type QueryVariables = Simplify<FetchQuestionListQueryVariables>;
28-
export type Query = Simplify<FetchQuestionListQuery>;
27+
export type QueryVariables = Simplify<QuestionListQueryVariables>;
28+
export type Query = Simplify<QuestionListQuery>;
2929

3030
export const QUERY =
31-
"query fetchQuestionList($categorySlug:String!,$limit:Int,$skip:Int,$filters:QuestionListFilterInput!){questionList(categorySlug:$categorySlug limit:$limit skip:$skip filters:$filters){data{difficulty isPaidOnly questionFrontendId title titleSlug}totalNum}}";
31+
"query QuestionList($categorySlug:String!,$limit:Int,$skip:Int,$filters:QuestionListFilterInput!){questionList(categorySlug:$categorySlug limit:$limit skip:$skip filters:$filters){data{difficulty isPaidOnly questionFrontendId title titleSlug}totalNum}}";
3232

3333
export function fetchGraphQL(variables: QueryVariables): Promise<Query> {
3434
return getGraphQLClient().request(QUERY, variables);

workspaces/leetcode-api/src/api/question-list/query.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
query fetchQuestionList(
1+
query QuestionList(
22
$categorySlug: String!
33
$limit: Int
44
$skip: Int

workspaces/leetcode-api/src/api/recent-ac-submission-list/fetchGraphQL.generated.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import type { Simplify } from "type-fest";
44

55
import { getGraphQLClient } from "../../getGraphQLClient.ts";
66

7-
type FetchRecentAcSubmissionListQueryVariables = Types.Exact<{
7+
type RecentAcSubmissionListQueryVariables = Types.Exact<{
88
username: Types.Scalars["String"]["input"];
99
limit: Types.Scalars["Int"]["input"];
1010
}>;
1111

12-
type FetchRecentAcSubmissionListQuery = {
12+
type RecentAcSubmissionListQuery = {
1313
recentAcSubmissionList?: Array<{
1414
id?: string | null;
1515
title?: string | null;
@@ -18,12 +18,11 @@ type FetchRecentAcSubmissionListQuery = {
1818
}> | null;
1919
};
2020

21-
export type QueryVariables =
22-
Simplify<FetchRecentAcSubmissionListQueryVariables>;
23-
export type Query = Simplify<FetchRecentAcSubmissionListQuery>;
21+
export type QueryVariables = Simplify<RecentAcSubmissionListQueryVariables>;
22+
export type Query = Simplify<RecentAcSubmissionListQuery>;
2423

2524
export const QUERY =
26-
"query fetchRecentAcSubmissionList($username:String!,$limit:Int!){recentAcSubmissionList(username:$username,limit:$limit){id title titleSlug timestamp}}";
25+
"query RecentAcSubmissionList($username:String!,$limit:Int!){recentAcSubmissionList(username:$username,limit:$limit){id title titleSlug timestamp}}";
2726

2827
export function fetchGraphQL(variables: QueryVariables): Promise<Query> {
2928
return getGraphQLClient().request(QUERY, variables);

workspaces/leetcode-api/src/api/recent-ac-submission-list/query.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
query fetchRecentAcSubmissionList($username: String!, $limit: Int!) {
1+
query RecentAcSubmissionList($username: String!, $limit: Int!) {
22
recentAcSubmissionList(username: $username, limit: $limit) {
33
id
44
title

workspaces/leetcode-api/src/api/topic/fetchGraphQL.generated.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ import type { Simplify } from "type-fest";
44

55
import { getGraphQLClient } from "../../getGraphQLClient.ts";
66

7-
type FetchTopicQueryVariables = Types.Exact<{
7+
type TopicQueryVariables = Types.Exact<{
88
topicId: Types.Scalars["Int"]["input"];
99
}>;
1010

11-
type FetchTopicQuery = {
11+
type TopicQuery = {
1212
topic?: {
1313
title: string;
1414
solutionTags: Array<{ slug: string } | null>;
1515
post: { content: string };
1616
} | null;
1717
};
1818

19-
export type QueryVariables = Simplify<FetchTopicQueryVariables>;
20-
export type Query = Simplify<FetchTopicQuery>;
19+
export type QueryVariables = Simplify<TopicQueryVariables>;
20+
export type Query = Simplify<TopicQuery>;
2121

2222
export const QUERY =
23-
"query fetchTopic($topicId:Int!){topic(id:$topicId){title solutionTags{slug}post{content}}}";
23+
"query Topic($topicId:Int!){topic(id:$topicId){title solutionTags{slug}post{content}}}";
2424

2525
export function fetchGraphQL(variables: QueryVariables): Promise<Query> {
2626
return getGraphQLClient().request(QUERY, variables);

workspaces/leetcode-api/src/api/topic/query.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
query fetchTopic($topicId: Int!) {
1+
query Topic($topicId: Int!) {
22
topic(id: $topicId) {
33
title
44
solutionTags {

workspaces/leetcode-api/src/scripts/codegen/graphqlCodegenPlugin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { PluginFunction } from "@graphql-codegen/plugin-helpers";
2-
import { pascalCase } from "change-case";
32
import graphqlQueryCompress from "graphql-query-compress";
43
import invariant from "invariant";
54
import nullthrows from "nullthrows";
@@ -31,8 +30,8 @@ export const plugin: PluginFunction<{}> = function plugin(_schema, documents) {
3130

3231
// Note: The import will be moved to the top by ESLint post-processing.
3332
return `
34-
export type QueryVariables = Simplify<${pascalCase(operationName)}QueryVariables>;
35-
export type Query = Simplify<${pascalCase(operationName)}Query>;
33+
export type QueryVariables = Simplify<${operationName}QueryVariables>;
34+
export type Query = Simplify<${operationName}Query>;
3635
3736
export const QUERY = ${JSON.stringify(minifiedGraphql)};
3837

0 commit comments

Comments
 (0)