Skip to content

Commit ace206f

Browse files
committed
chore(templates): clean up redundant comments in garph and mailgun templates
1 parent b18a801 commit ace206f

7 files changed

Lines changed: 1 addition & 40 deletions

File tree

packages/template-generator/templates/api/garph/fullstack/astro/src/utils/garph.ts.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
mutationType,
1212
} from "@{{projectName}}/api/index";
1313

14-
// Create QueryClient for React Query integration
1514
export const queryClient = new QueryClient({
1615
defaultOptions: {
1716
queries: {
@@ -21,12 +20,10 @@ export const queryClient = new QueryClient({
2120
},
2221
});
2322

24-
// Build a GraphQL schema from garph types for GQty client generation
2523
const schema = buildSchema({ g, resolvers: {} });
2624
const generatedSchema = createGeneratedSchema(schema);
2725
const scalarsEnumsHash = createScalarsEnumsHash(schema);
2826

29-
// Create type-safe GraphQL client
3027
type Schema = InferClient<{ query: typeof queryType; mutation: typeof mutationType }>;
3128

3229
export const client = createClient<Schema>({
@@ -38,10 +35,8 @@ export const client = createClient<Schema>({
3835
{{/if}}
3936
});
4037

41-
// Export typed query and mutation functions
4238
export const { query, mutation, resolved } = client;
4339

44-
// Helper for React Query integration
4540
export async function graphqlFetcher<T>(
4641
fn: () => T | Promise<T>
4742
): Promise<T> {

packages/template-generator/templates/api/garph/fullstack/next/src/utils/garph.ts.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
mutationType,
1212
} from "@{{projectName}}/api/index";
1313

14-
// Create QueryClient for React Query integration
1514
export const queryClient = new QueryClient({
1615
defaultOptions: {
1716
queries: {
@@ -21,12 +20,10 @@ export const queryClient = new QueryClient({
2120
},
2221
});
2322

24-
// Build a GraphQL schema from garph types for GQty client generation
2523
const schema = buildSchema({ g, resolvers: {} });
2624
const generatedSchema = createGeneratedSchema(schema);
2725
const scalarsEnumsHash = createScalarsEnumsHash(schema);
2826

29-
// Create type-safe GraphQL client
3027
type Schema = InferClient<{ query: typeof queryType; mutation: typeof mutationType }>;
3128

3229
export const client = createClient<Schema>({
@@ -38,10 +35,8 @@ export const client = createClient<Schema>({
3835
{{/if}}
3936
});
4037

41-
// Export typed query and mutation functions
4238
export const { query, mutation, resolved } = client;
4339

44-
// Helper for React Query integration
4540
export async function graphqlFetcher<T>(
4641
fn: () => T | Promise<T>
4742
): Promise<T> {

packages/template-generator/templates/api/garph/fullstack/tanstack-start/src/utils/garph.ts.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
mutationType,
1212
} from "@{{projectName}}/api/index";
1313

14-
// Create QueryClient for React Query integration
1514
export const queryClient = new QueryClient({
1615
defaultOptions: {
1716
queries: {
@@ -21,12 +20,10 @@ export const queryClient = new QueryClient({
2120
},
2221
});
2322

24-
// Build a GraphQL schema from garph types for GQty client generation
2523
const schema = buildSchema({ g, resolvers: {} });
2624
const generatedSchema = createGeneratedSchema(schema);
2725
const scalarsEnumsHash = createScalarsEnumsHash(schema);
2826

29-
// Create type-safe GraphQL client
3027
type Schema = InferClient<{ query: typeof queryType; mutation: typeof mutationType }>;
3128

3229
export const client = createClient<Schema>({
@@ -38,10 +35,8 @@ export const client = createClient<Schema>({
3835
{{/if}}
3936
});
4037

41-
// Export typed query and mutation functions
4238
export const { query, mutation, resolved } = client;
4339

44-
// Helper for React Query integration
4540
export async function graphqlFetcher<T>(
4641
fn: () => T | Promise<T>
4742
): Promise<T> {

packages/template-generator/templates/api/garph/native/utils/garph.ts.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from "@{{projectName}}/api/index";
1313
import { API_URL } from "@/lib/api";
1414

15-
// Create QueryClient for React Query integration
1615
export const queryClient = new QueryClient({
1716
defaultOptions: {
1817
queries: {
@@ -22,12 +21,10 @@ export const queryClient = new QueryClient({
2221
},
2322
});
2423

25-
// Build a GraphQL schema from garph types for GQty client generation
2624
const schema = buildSchema({ g, resolvers: {} });
2725
const generatedSchema = createGeneratedSchema(schema);
2826
const scalarsEnumsHash = createScalarsEnumsHash(schema);
2927

30-
// Create type-safe GraphQL client
3128
type Schema = InferClient<{ query: typeof queryType; mutation: typeof mutationType }>;
3229

3330
export const client = createClient<Schema>({
@@ -39,10 +36,8 @@ export const client = createClient<Schema>({
3936
{{/if}}
4037
});
4138

42-
// Export typed query and mutation functions
4339
export const { query, mutation, resolved } = client;
4440

45-
// Helper for React Query integration
4641
export async function graphqlFetcher<T>(
4742
fn: () => T | Promise<T>
4843
): Promise<T> {

packages/template-generator/templates/api/garph/web/astro/src/utils/garph.ts.hbs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ import {
1111
} from "@{{projectName}}/api/index";
1212
import { env } from "@{{projectName}}/env/web";
1313

14-
// Build a GraphQL schema from garph types for GQty client generation
1514
const schema = buildSchema({ g, resolvers: {} });
1615
const generatedSchema = createGeneratedSchema(schema);
1716
const scalarsEnumsHash = createScalarsEnumsHash(schema);
1817

19-
// Create type-safe GraphQL client
2018
type Schema = InferClient<{ query: typeof queryType; mutation: typeof mutationType }>;
2119

2220
export const client = createClient<Schema>({
@@ -28,10 +26,8 @@ export const client = createClient<Schema>({
2826
{{/if}}
2927
});
3028

31-
// Export typed query and mutation functions
3229
export const { query, mutation, resolved } = client;
3330

34-
// Helper for fetching data
3531
export async function graphqlFetcher<T>(
3632
fn: () => T | Promise<T>
3733
): Promise<T> {

packages/template-generator/templates/api/garph/web/react/base/src/utils/garph.ts.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from "@{{projectName}}/api/index";
1313
import { env } from "@{{projectName}}/env/web";
1414

15-
// Create QueryClient for React Query integration
1615
export const queryClient = new QueryClient({
1716
defaultOptions: {
1817
queries: {
@@ -22,12 +21,10 @@ export const queryClient = new QueryClient({
2221
},
2322
});
2423

25-
// Build a GraphQL schema from garph types for GQty client generation
2624
const schema = buildSchema({ g, resolvers: {} });
2725
const generatedSchema = createGeneratedSchema(schema);
2826
const scalarsEnumsHash = createScalarsEnumsHash(schema);
2927

30-
// Create type-safe GraphQL client
3128
type Schema = InferClient<{ query: typeof queryType; mutation: typeof mutationType }>;
3229

3330
export const client = createClient<Schema>({
@@ -43,10 +40,8 @@ export const client = createClient<Schema>({
4340
{{/if}}
4441
});
4542

46-
// Export typed query and mutation functions
4743
export const { query, mutation, resolved } = client;
4844

49-
// Helper for React Query integration
5045
export async function graphqlFetcher<T>(
5146
fn: () => T | Promise<T>
5247
): Promise<T> {

packages/template-generator/templates/email/mailgun/server/base/src/lib/email.ts.hbs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { MailgunMessageData } from "mailgun.js/definitions";
33
import { Interfaces } from "mailgun.js/definitions";
44
import FormData from "form-data";
55

6-
// Initialize Mailgun client
76
const mailgun = new Mailgun(FormData);
87
const mg: Interfaces.IMailgunClient = mailgun.client({
98
username: "api",
@@ -32,7 +31,6 @@ export interface SendEmailOptions {
3231
}
3332

3433
/**
35-
* Send an email using Mailgun
3634
* @see https://documentation.mailgun.com/en/latest/api-sending-messages.html
3735
*/
3836
export async function sendEmail(options: SendEmailOptions) {
@@ -88,7 +86,6 @@ export async function sendEmail(options: SendEmailOptions) {
8886
}
8987

9088
/**
91-
* Send multiple emails in a batch using Mailgun's recipient variables
9289
* @see https://documentation.mailgun.com/en/latest/user_manual.html#batch-sending
9390
*/
9491
export async function sendBatchEmails(
@@ -107,7 +104,6 @@ export async function sendBatchEmails(
107104
const fromAddress =
108105
commonOptions?.from || process.env.MAILGUN_FROM_EMAIL || "noreply@example.com";
109106

110-
// Mailgun batch sending uses recipient variables
111107
const recipients = emails.map((e) => e.to);
112108
const recipientVariables: Record<string, Record<string, string>> = {};
113109

@@ -118,7 +114,6 @@ export async function sendBatchEmails(
118114
}
119115

120116
try {
121-
// For batch emails, we use the first email as template
122117
const firstEmail = emails[0];
123118
if (!firstEmail) throw new Error("No emails provided");
124119

@@ -143,7 +138,6 @@ export async function sendBatchEmails(
143138
}
144139

145140
/**
146-
* Send an email using a Mailgun template
147141
* @see https://documentation.mailgun.com/en/latest/api-sending-messages.html#sending-via-api
148142
*/
149143
export async function sendTemplateEmail(options: {
@@ -180,8 +174,7 @@ export async function sendTemplateEmail(options: {
180174
}
181175

182176
/**
183-
* Validate an email address using Mailgun's email validation API
184-
* Note: This requires the email validation feature to be enabled on your account
177+
* Requires the email validation feature enabled on your Mailgun account.
185178
* @see https://documentation.mailgun.com/en/latest/api-email-validation.html
186179
*/
187180
export async function validateEmail(email: string) {
@@ -201,9 +194,6 @@ export async function validateEmail(email: string) {
201194
}
202195
}
203196

204-
/**
205-
* Get the Mailgun client for advanced usage
206-
*/
207197
export function getMailgunClient(): Interfaces.IMailgunClient {
208198
return mg;
209199
}

0 commit comments

Comments
 (0)