Skip to content

Commit

Permalink
Reformatted Code with Biome's Suggested Indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sancheet230 authored Feb 8, 2025
1 parent 93462de commit ec39101
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions src/graphql/types/Organization/organizationConnectionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ import { Organization } from "~/src/graphql/types/Organization/Organization";
import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError";

const organizationConnectionListArgumentsSchema = z.object({
first: z.number().min(1).max(100).default(10),
skip: z.number().min(0).default(0),
first: z.number().min(1).max(100).default(10),
skip: z.number().min(0).default(0),
});

builder.queryField("organizationConnectionList", (t) =>
t.field({
args: {
first: t.arg({ type: "Int", required: false }),
skip: t.arg({ type: "Int", required: false }),
},
type: [Organization],
resolve: async (_parent, args, ctx) => {
const {
data: parsedArgs,
error,
success,
} = organizationConnectionListArgumentsSchema.safeParse(args);
t.field({
args: {
first: t.arg({ type: "Int", required: false }),
skip: t.arg({ type: "Int", required: false }),
},
type: [Organization],
resolve: async (_parent, args, ctx) => {
const {
data: parsedArgs,
error,
success,
} = organizationConnectionListArgumentsSchema.safeParse(args);

if (!success) {
throw new TalawaGraphQLError({
extensions: {
code: "invalid_arguments",
issues: error.issues.map((issue) => ({
argumentPath: issue.path,
message: issue.message,
})),
},
});
}
if (!success) {
throw new TalawaGraphQLError({
extensions: {
code: "invalid_arguments",
issues: error.issues.map((issue) => ({
argumentPath: issue.path,
message: issue.message,
})),
},
});
}

const { first, skip } = parsedArgs;
const { first, skip } = parsedArgs;

// Fetch organizations with pagination
const organizations =
await ctx.drizzleClient.query.organizationsTable.findMany({
limit: first,
offset: skip,
});
// Fetch organizations with pagination
const organizations =
await ctx.drizzleClient.query.organizationsTable.findMany({
limit: first,
offset: skip,
});

return organizations;
},
}),
return organizations;
},
}),
);

0 comments on commit ec39101

Please sign in to comment.