From 47e52caafcb592b136e397e1ed50d3646bd8ce92 Mon Sep 17 00:00:00 2001 From: xoldd <xoldyckk@gmail.com> Date: Thu, 2 Jan 2025 00:10:36 +0530 Subject: [PATCH 1/5] update drizzle-zod updated drizzle zod to the latest version and fixed the breaking changes --- package.json | 4 +- pnpm-lock.yaml | 60 +++++++++---------- .../tables/advertisementAttachments.ts | 2 +- src/drizzle/tables/advertisements.ts | 4 +- src/drizzle/tables/agendaFolders.ts | 2 +- src/drizzle/tables/agendaItems.ts | 4 +- src/drizzle/tables/chatMessages.ts | 2 +- src/drizzle/tables/chats.ts | 6 +- src/drizzle/tables/comments.ts | 2 +- src/drizzle/tables/eventAttachments.ts | 2 +- src/drizzle/tables/events.ts | 4 +- src/drizzle/tables/fundCampaignPledges.ts | 4 +- src/drizzle/tables/fundCampaigns.ts | 2 +- src/drizzle/tables/funds.ts | 2 +- src/drizzle/tables/organizations.ts | 14 ++--- src/drizzle/tables/postAttachments.ts | 2 +- src/drizzle/tables/posts.ts | 2 +- src/drizzle/tables/tagFolders.ts | 2 +- src/drizzle/tables/tags.ts | 2 +- src/drizzle/tables/users.ts | 14 ++--- src/drizzle/tables/venueAttachments.ts | 2 +- src/drizzle/tables/venues.ts | 4 +- .../inputs/MutationUpdateEventInput.ts | 5 +- src/plugins/seedPostgres.ts | 6 ++ 24 files changed, 78 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index 078214dec9..a4da5da337 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "ajv-formats": "^3.0.1", "close-with-grace": "^2.1.0", "drizzle-orm": "^0.38.3", - "drizzle-zod": "0.5.1", + "drizzle-zod": "0.6.1", "env-schema": "^6.0.0", "fastify": "^5.2.0", "fastify-plugin": "^5.0.1", @@ -37,7 +37,7 @@ "@faker-js/faker": "^9.3.0", "@swc/cli": "0.5.2", "@swc/core": "^1.10.4", - "@types/node": "^22.10.2", + "@types/node": "^22.10.3", "@vitest/coverage-v8": "^2.1.8", "drizzle-kit": "^0.30.1", "gql.tada": "^1.8.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67df2bb6e1..5061ad56ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,8 +45,8 @@ importers: specifier: ^0.38.3 version: 0.38.3(postgres@3.4.5) drizzle-zod: - specifier: 0.5.1 - version: 0.5.1(drizzle-orm@0.38.3(postgres@3.4.5))(zod@3.24.1) + specifier: 0.6.1 + version: 0.6.1(drizzle-orm@0.38.3(postgres@3.4.5))(zod@3.24.1) env-schema: specifier: ^6.0.0 version: 6.0.0 @@ -100,11 +100,11 @@ importers: specifier: ^1.10.4 version: 1.10.4 '@types/node': - specifier: ^22.10.2 - version: 22.10.2 + specifier: ^22.10.3 + version: 22.10.3 '@vitest/coverage-v8': specifier: ^2.1.8 - version: 2.1.8(vitest@2.1.8(@types/node@22.10.2)) + version: 2.1.8(vitest@2.1.8(@types/node@22.10.3)) drizzle-kit: specifier: ^0.30.1 version: 0.30.1 @@ -128,10 +128,10 @@ importers: version: 5.7.2 vite-tsconfig-paths: specifier: ^5.1.4 - version: 5.1.4(typescript@5.7.2)(vite@5.4.11(@types/node@22.10.2)) + version: 5.1.4(typescript@5.7.2)(vite@5.4.11(@types/node@22.10.3)) vitest: specifier: ^2.1.8 - version: 2.1.8(@types/node@22.10.2) + version: 2.1.8(@types/node@22.10.3) packages: @@ -1322,8 +1322,8 @@ packages: '@types/http-cache-semantics@4.0.4': resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==} - '@types/node@22.10.2': - resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + '@types/node@22.10.3': + resolution: {integrity: sha512-DifAyw4BkrufCILvD3ucnuN8eydUfc/C1GlyrnI+LK6543w5/L3VeVgf05o3B4fqSXP1dKYLOZsKfutpxPzZrw==} '@vitest/coverage-v8@2.1.8': resolution: {integrity: sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==} @@ -1737,11 +1737,11 @@ packages: sqlite3: optional: true - drizzle-zod@0.5.1: - resolution: {integrity: sha512-C/8bvzUH/zSnVfwdSibOgFjLhtDtbKYmkbPbUCq46QZyZCH6kODIMSOgZ8R7rVjoI+tCj3k06MRJMDqsIeoS4A==} + drizzle-zod@0.6.1: + resolution: {integrity: sha512-huEbUgnsuR8tupnmLiyB2F1I2H9dswI3GfM36IbIqx9i0YUeYjRsDpJVyFVeziUvI1ogT9JHRL2Q03cC4QmvxA==} peerDependencies: - drizzle-orm: '>=0.23.13' - zod: '*' + drizzle-orm: '>=0.36.0' + zod: '>=3.0.0' dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} @@ -3778,11 +3778,11 @@ snapshots: '@types/http-cache-semantics@4.0.4': {} - '@types/node@22.10.2': + '@types/node@22.10.3': dependencies: undici-types: 6.20.0 - '@vitest/coverage-v8@2.1.8(vitest@2.1.8(@types/node@22.10.2))': + '@vitest/coverage-v8@2.1.8(vitest@2.1.8(@types/node@22.10.3))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -3796,7 +3796,7 @@ snapshots: std-env: 3.8.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.1.8(@types/node@22.10.2) + vitest: 2.1.8(@types/node@22.10.3) transitivePeerDependencies: - supports-color @@ -3807,13 +3807,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.2))': + '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.3))': dependencies: '@vitest/spy': 2.1.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.11(@types/node@22.10.2) + vite: 5.4.11(@types/node@22.10.3) '@vitest/pretty-format@2.1.8': dependencies: @@ -4135,7 +4135,7 @@ snapshots: optionalDependencies: postgres: 3.4.5 - drizzle-zod@0.5.1(drizzle-orm@0.38.3(postgres@3.4.5))(zod@3.24.1): + drizzle-zod@0.6.1(drizzle-orm@0.38.3(postgres@3.4.5))(zod@3.24.1): dependencies: drizzle-orm: 0.38.3(postgres@3.4.5) zod: 3.24.1 @@ -5352,13 +5352,13 @@ snapshots: uuidv7@1.0.2: {} - vite-node@2.1.8(@types/node@22.10.2): + vite-node@2.1.8(@types/node@22.10.3): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 1.1.2 - vite: 5.4.11(@types/node@22.10.2) + vite: 5.4.11(@types/node@22.10.3) transitivePeerDependencies: - '@types/node' - less @@ -5370,30 +5370,30 @@ snapshots: - supports-color - terser - vite-tsconfig-paths@5.1.4(typescript@5.7.2)(vite@5.4.11(@types/node@22.10.2)): + vite-tsconfig-paths@5.1.4(typescript@5.7.2)(vite@5.4.11(@types/node@22.10.3)): dependencies: debug: 4.4.0 globrex: 0.1.2 tsconfck: 3.1.4(typescript@5.7.2) optionalDependencies: - vite: 5.4.11(@types/node@22.10.2) + vite: 5.4.11(@types/node@22.10.3) transitivePeerDependencies: - supports-color - typescript - vite@5.4.11(@types/node@22.10.2): + vite@5.4.11(@types/node@22.10.3): dependencies: esbuild: 0.21.5 postcss: 8.4.49 rollup: 4.29.1 optionalDependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.3 fsevents: 2.3.3 - vitest@2.1.8(@types/node@22.10.2): + vitest@2.1.8(@types/node@22.10.3): dependencies: '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.2)) + '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.3)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.8 '@vitest/snapshot': 2.1.8 @@ -5409,11 +5409,11 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@22.10.2) - vite-node: 2.1.8(@types/node@22.10.2) + vite: 5.4.11(@types/node@22.10.3) + vite-node: 2.1.8(@types/node@22.10.3) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.10.2 + '@types/node': 22.10.3 transitivePeerDependencies: - less - lightningcss diff --git a/src/drizzle/tables/advertisementAttachments.ts b/src/drizzle/tables/advertisementAttachments.ts index cca68084f1..d9bf84422f 100755 --- a/src/drizzle/tables/advertisementAttachments.ts +++ b/src/drizzle/tables/advertisementAttachments.ts @@ -106,6 +106,6 @@ export const advertisementAttachmentsTableRelations = relations( export const advertisementAttachmentsTableInsertSchema = createInsertSchema( advertisementAttachmentsTable, { - name: (schema) => schema.name.min(1), + name: (schema) => schema.min(1), }, ); diff --git a/src/drizzle/tables/advertisements.ts b/src/drizzle/tables/advertisements.ts index 85ff09eaef..22e577c71d 100755 --- a/src/drizzle/tables/advertisements.ts +++ b/src/drizzle/tables/advertisements.ts @@ -151,7 +151,7 @@ export const advertisementsTableRelations = relations( export const advertisementsTableInsertSchema = createInsertSchema( advertisementsTable, { - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), }, ); diff --git a/src/drizzle/tables/agendaFolders.ts b/src/drizzle/tables/agendaFolders.ts index dcb14b504d..8290c00ed4 100755 --- a/src/drizzle/tables/agendaFolders.ts +++ b/src/drizzle/tables/agendaFolders.ts @@ -149,6 +149,6 @@ export const agendaFoldersTableRelations = relations( export const agendaFoldersTableInsertSchema = createInsertSchema( agendaFoldersTable, { - name: (schema) => schema.name.min(1).max(256), + name: (schema) => schema.min(1).max(256), }, ); diff --git a/src/drizzle/tables/agendaItems.ts b/src/drizzle/tables/agendaItems.ts index cf051dc26c..6da5c6de4b 100755 --- a/src/drizzle/tables/agendaItems.ts +++ b/src/drizzle/tables/agendaItems.ts @@ -124,7 +124,7 @@ export const agendaItemsTableRelations = relations( export const agendaItemsTableInsertSchema = createInsertSchema( agendaItemsTable, { - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), }, ); diff --git a/src/drizzle/tables/chatMessages.ts b/src/drizzle/tables/chatMessages.ts index dd411ff817..892c00f91d 100644 --- a/src/drizzle/tables/chatMessages.ts +++ b/src/drizzle/tables/chatMessages.ts @@ -120,6 +120,6 @@ export const chatMessagesTableRelations = relations( export const chatMessagesTableInsertSchema = createInsertSchema( chatMessagesTable, { - body: (schema) => schema.body.min(1).max(2048), + body: (schema) => schema.min(1).max(2048), }, ); diff --git a/src/drizzle/tables/chats.ts b/src/drizzle/tables/chats.ts index b352f5ba65..a3207a8b49 100644 --- a/src/drizzle/tables/chats.ts +++ b/src/drizzle/tables/chats.ts @@ -128,7 +128,7 @@ export const chatsTableRelations = relations(chatsTable, ({ one, many }) => ({ })); export const chatsTableInsertSchema = createInsertSchema(chatsTable, { - avatarName: (schema) => schema.avatarName.min(1), - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), + avatarName: (schema) => schema.min(1), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), }); diff --git a/src/drizzle/tables/comments.ts b/src/drizzle/tables/comments.ts index 39a8a92b48..a676564042 100755 --- a/src/drizzle/tables/comments.ts +++ b/src/drizzle/tables/comments.ts @@ -108,5 +108,5 @@ export const commentsTableRelations = relations( ); export const commentsTableInsertSchema = createInsertSchema(commentsTable, { - body: (schema) => schema.body.min(1).max(2048), + body: (schema) => schema.min(1).max(2048), }); diff --git a/src/drizzle/tables/eventAttachments.ts b/src/drizzle/tables/eventAttachments.ts index 159c82cc9d..85f8265b2f 100755 --- a/src/drizzle/tables/eventAttachments.ts +++ b/src/drizzle/tables/eventAttachments.ts @@ -105,6 +105,6 @@ export const eventAttachmentsTableRelations = relations( export const eventAttachmentsTableInsertSchema = createInsertSchema( eventAttachmentsTable, { - name: (schema) => schema.name.min(1), + name: (schema) => schema.min(1), }, ); diff --git a/src/drizzle/tables/events.ts b/src/drizzle/tables/events.ts index 781ce49ecc..254a7011a5 100755 --- a/src/drizzle/tables/events.ts +++ b/src/drizzle/tables/events.ts @@ -149,6 +149,6 @@ export const eventsTableRelations = relations(eventsTable, ({ many, one }) => ({ })); export const eventsTableInsertSchema = createInsertSchema(eventsTable, { - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), }); diff --git a/src/drizzle/tables/fundCampaignPledges.ts b/src/drizzle/tables/fundCampaignPledges.ts index 2c3ea694e4..13fd82c7f1 100644 --- a/src/drizzle/tables/fundCampaignPledges.ts +++ b/src/drizzle/tables/fundCampaignPledges.ts @@ -134,7 +134,7 @@ export const fundCampaignPledgesTableRelations = relations( export const fundCampaignPledgesTableInsertSchema = createInsertSchema( fundCampaignPledgesTable, { - amount: (schema) => schema.amount.min(1), - note: (schema) => schema.note.min(1).max(2048), + amount: (schema) => schema.min(1), + note: (schema) => schema.min(1).max(2048), }, ); diff --git a/src/drizzle/tables/fundCampaigns.ts b/src/drizzle/tables/fundCampaigns.ts index c58cca68fd..b19a87fae8 100644 --- a/src/drizzle/tables/fundCampaigns.ts +++ b/src/drizzle/tables/fundCampaigns.ts @@ -149,6 +149,6 @@ export const fundCampaignsTableRelations = relations( export const fundCampaignsTableInsertSchema = createInsertSchema( fundCampaignsTable, { - name: (schema) => schema.name.min(1).max(256), + name: (schema) => schema.min(1).max(256), }, ); diff --git a/src/drizzle/tables/funds.ts b/src/drizzle/tables/funds.ts index e43ab93fbc..4bcfe93079 100755 --- a/src/drizzle/tables/funds.ts +++ b/src/drizzle/tables/funds.ts @@ -119,5 +119,5 @@ export const fundsTableRelations = relations(fundsTable, ({ one, many }) => ({ })); export const fundsTableInsertSchema = createInsertSchema(fundsTable, { - name: (schema) => schema.name.min(1).max(256), + name: (schema) => schema.min(1).max(256), }); diff --git a/src/drizzle/tables/organizations.ts b/src/drizzle/tables/organizations.ts index 96f35c0510..f64fe64aa7 100755 --- a/src/drizzle/tables/organizations.ts +++ b/src/drizzle/tables/organizations.ts @@ -211,12 +211,12 @@ export const organizationsTableRelations = relations( export const organizationsTableInsertSchema = createInsertSchema( organizationsTable, { - address: (schema) => schema.address.min(1).max(1024), - avatarName: (schema) => schema.avatarName.min(1), - city: (schema) => schema.city.min(1).max(64), - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), - postalCode: (schema) => schema.postalCode.min(1).max(32), - state: (schema) => schema.state.min(1).max(64), + address: (schema) => schema.min(1).max(1024), + avatarName: (schema) => schema.min(1), + city: (schema) => schema.min(1).max(64), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), + postalCode: (schema) => schema.min(1).max(32), + state: (schema) => schema.min(1).max(64), }, ); diff --git a/src/drizzle/tables/postAttachments.ts b/src/drizzle/tables/postAttachments.ts index 7e30cb054e..955e9f48a7 100755 --- a/src/drizzle/tables/postAttachments.ts +++ b/src/drizzle/tables/postAttachments.ts @@ -105,6 +105,6 @@ export const postAttachmentsTableRelations = relations( export const postAttachmentsTableInsertSchema = createInsertSchema( postAttachmentsTable, { - name: (schema) => schema.name.min(1), + name: (schema) => schema.min(1), }, ); diff --git a/src/drizzle/tables/posts.ts b/src/drizzle/tables/posts.ts index ba3ce79745..91bb7917c3 100755 --- a/src/drizzle/tables/posts.ts +++ b/src/drizzle/tables/posts.ts @@ -130,5 +130,5 @@ export const postsTableRelations = relations(postsTable, ({ many, one }) => ({ })); export const postsTableInsertSchema = createInsertSchema(postsTable, { - caption: (schema) => schema.caption.min(1).max(2048), + caption: (schema) => schema.min(1).max(2048), }); diff --git a/src/drizzle/tables/tagFolders.ts b/src/drizzle/tables/tagFolders.ts index df79f058f7..a812b94ec3 100644 --- a/src/drizzle/tables/tagFolders.ts +++ b/src/drizzle/tables/tagFolders.ts @@ -141,5 +141,5 @@ export const tagFoldersTableRelations = relations( ); export const tagFoldersTableInsertSchema = createInsertSchema(tagFoldersTable, { - name: (schema) => schema.name.min(1).max(256), + name: (schema) => schema.min(1).max(256), }); diff --git a/src/drizzle/tables/tags.ts b/src/drizzle/tables/tags.ts index ff65bc2a49..1a8ba02336 100755 --- a/src/drizzle/tables/tags.ts +++ b/src/drizzle/tables/tags.ts @@ -129,5 +129,5 @@ export const tagsTableRelations = relations(tagsTable, ({ many, one }) => ({ })); export const tagsTableInsertSchema = createInsertSchema(tagsTable, { - name: (schema) => schema.name.min(1).max(256), + name: (schema) => schema.min(1).max(256), }); diff --git a/src/drizzle/tables/users.ts b/src/drizzle/tables/users.ts index 7abe5d9d30..831dd69525 100755 --- a/src/drizzle/tables/users.ts +++ b/src/drizzle/tables/users.ts @@ -643,11 +643,11 @@ export const usersTableRelations = relations(usersTable, ({ many, one }) => ({ })); export const usersTableInsertSchema = createInsertSchema(usersTable, { - address: (schema) => schema.address.min(1).max(1024), - avatarName: (schema) => schema.avatarName.min(1), - city: (schema) => schema.city.min(1).max(64), - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), - postalCode: (schema) => schema.postalCode.min(1).max(32), - state: (schema) => schema.state.min(1).max(64), + address: (schema) => schema.min(1).max(1024), + avatarName: (schema) => schema.min(1), + city: (schema) => schema.min(1).max(64), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), + postalCode: (schema) => schema.min(1).max(32), + state: (schema) => schema.min(1).max(64), }); diff --git a/src/drizzle/tables/venueAttachments.ts b/src/drizzle/tables/venueAttachments.ts index 1112d35d75..7fc2a2a644 100755 --- a/src/drizzle/tables/venueAttachments.ts +++ b/src/drizzle/tables/venueAttachments.ts @@ -105,6 +105,6 @@ export const venueAttachmentsTableRelations = relations( export const venueAttachmentsTableInsertSchema = createInsertSchema( venueAttachmentsTable, { - name: (schema) => schema.name.min(1), + name: (schema) => schema.min(1), }, ); diff --git a/src/drizzle/tables/venues.ts b/src/drizzle/tables/venues.ts index a854652a32..4cc02aecd6 100755 --- a/src/drizzle/tables/venues.ts +++ b/src/drizzle/tables/venues.ts @@ -125,6 +125,6 @@ export const venuesTableRelations = relations(venuesTable, ({ many, one }) => ({ })); export const venuesTableInsertSchema = createInsertSchema(venuesTable, { - description: (schema) => schema.description.min(1).max(2048), - name: (schema) => schema.name.min(1).max(256), + description: (schema) => schema.min(1).max(2048), + name: (schema) => schema.min(1).max(256), }); diff --git a/src/graphql/inputs/MutationUpdateEventInput.ts b/src/graphql/inputs/MutationUpdateEventInput.ts index fca54c82dc..74ebc1c0d1 100644 --- a/src/graphql/inputs/MutationUpdateEventInput.ts +++ b/src/graphql/inputs/MutationUpdateEventInput.ts @@ -5,10 +5,7 @@ import { isNotNullish } from "~/src/utilities/isNotNullish"; export const mutationUpdateEventInputSchema = z .object({ - description: eventsTableInsertSchema.shape.description - .unwrap() - .unwrap() - .optional(), + description: eventsTableInsertSchema.shape.description.optional(), endAt: eventsTableInsertSchema.shape.endAt.optional(), id: eventsTableInsertSchema.shape.id.unwrap(), name: eventsTableInsertSchema.shape.name.optional(), diff --git a/src/plugins/seedPostgres.ts b/src/plugins/seedPostgres.ts index a105716b82..7abfd65c69 100644 --- a/src/plugins/seedPostgres.ts +++ b/src/plugins/seedPostgres.ts @@ -56,7 +56,11 @@ const plugin: FastifyPluginAsync = async (fastify) => { const userId = uuidv7(); const input: z.infer<typeof usersTableInsertSchema> = { + address: null, + avatarName: null, + city: null, creatorId: userId, + description: null, emailAddress: fastify.envConfig.API_ADMINISTRATOR_USER_EMAIL_ADDRESS, id: userId, isEmailAddressVerified: true, @@ -64,7 +68,9 @@ const plugin: FastifyPluginAsync = async (fastify) => { passwordHash: await hash( fastify.envConfig.API_ADMINISTRATOR_USER_PASSWORD, ), + postalCode: null, role: "administrator", + state: null, }; try { From b64ecf51d1cb37b60646a862107cb825e5bb3057 Mon Sep 17 00:00:00 2001 From: xoldd <xoldyckk@gmail.com> Date: Thu, 2 Jan 2025 00:10:47 +0530 Subject: [PATCH 2/5] fix `/objects/:name` route error handling --- src/routes/objects.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/routes/objects.ts b/src/routes/objects.ts index 97e62d52dc..11e43c3df1 100644 --- a/src/routes/objects.ts +++ b/src/routes/objects.ts @@ -1,7 +1,7 @@ import type { Readable } from "node:stream"; import type { FastifyPluginAsyncTypebox } from "@fastify/type-provider-typebox"; import { Type } from "@sinclair/typebox"; -import { type BucketItemStat, InvalidObjectNameError } from "minio"; +import { type BucketItemStat, S3Error } from "minio"; /** * This fastify route plugin is used to initialize a `/objects/:name` endpoint on the fastify server for clients to fetch objects from the minio server. @@ -36,7 +36,12 @@ export const objects: FastifyPluginAsyncTypebox = async (fastify) => { `Error encountered while fetching the object with the name "${name}" from the minio server.`, ); - if (error instanceof InvalidObjectNameError) { + // https://github.com/minio/minio/blob/330dca9a354cdf445d71979170bbe3d27971d127/cmd/api-errors.go#L676C20-L676C29 + // https://github.com/minio/minio-js/blob/fd12add665720a025a7f2e6a76167f20c34d0e42/src/internal/xml-parser.ts#L72 + if ( + error instanceof S3Error && + (error.code === "NoSuchKey" || error.code === "NotFound") + ) { return reply.status(404).send({ message: `No object found with the name "${name}".`, }); From 13ae9eb3f066464617b937539bdb88ac13f95657 Mon Sep 17 00:00:00 2001 From: xoldd <xoldyckk@gmail.com> Date: Thu, 2 Jan 2025 00:10:51 +0530 Subject: [PATCH 3/5] removed custom messages from talawa graphql error instances --- docs/docs/tutorial-basics/_category_.json | 12 ++++---- docs/docs/tutorial-extras/_category_.json | 10 +++---- src/graphql/types/Advertisement/createdAt.ts | 5 +--- src/graphql/types/Advertisement/creator.ts | 6 +--- .../types/Advertisement/organization.ts | 3 +- src/graphql/types/Advertisement/updatedAt.ts | 5 +--- src/graphql/types/Advertisement/updater.ts | 6 +--- .../types/AgendaFolder/childFolders.ts | 5 +--- src/graphql/types/AgendaFolder/createdAt.ts | 6 +--- src/graphql/types/AgendaFolder/creator.ts | 7 +---- src/graphql/types/AgendaFolder/event.ts | 6 +--- src/graphql/types/AgendaFolder/items.ts | 5 +--- .../types/AgendaFolder/parentFolder.ts | 7 +---- src/graphql/types/AgendaFolder/updatedAt.ts | 6 +--- src/graphql/types/AgendaFolder/updater.ts | 7 +---- src/graphql/types/AgendaItem/createdAt.ts | 6 +--- src/graphql/types/AgendaItem/creator.ts | 7 +---- src/graphql/types/AgendaItem/folder.ts | 6 +--- src/graphql/types/AgendaItem/updatedAt.ts | 6 +--- src/graphql/types/AgendaItem/updater.ts | 7 +---- src/graphql/types/Chat/createdAt.ts | 5 +--- src/graphql/types/Chat/creator.ts | 6 +--- src/graphql/types/Chat/members.ts | 5 +--- src/graphql/types/Chat/messages.ts | 5 +--- src/graphql/types/Chat/organization.ts | 3 +- src/graphql/types/Chat/updatedAt.ts | 5 +--- src/graphql/types/Chat/updater.ts | 6 +--- src/graphql/types/ChatMessage/chat.ts | 3 +- src/graphql/types/ChatMessage/creator.ts | 3 +- .../types/ChatMessage/parentChatMessage.ts | 3 +- src/graphql/types/Comment/creator.ts | 3 +- src/graphql/types/Comment/downVoters.ts | 5 +--- src/graphql/types/Comment/downVotesCount.ts | 3 +- src/graphql/types/Comment/post.ts | 3 +- src/graphql/types/Comment/upVoters.ts | 5 +--- src/graphql/types/Comment/upVotesCount.ts | 3 +- src/graphql/types/Comment/updater.ts | 7 +---- src/graphql/types/Event/agendaFolders.ts | 5 +--- src/graphql/types/Event/createdAt.ts | 5 +--- src/graphql/types/Event/creator.ts | 6 +--- src/graphql/types/Event/organization.ts | 3 +- src/graphql/types/Event/updatedAt.ts | 5 +--- src/graphql/types/Event/updater.ts | 6 +--- src/graphql/types/Event/venues.ts | 8 +---- src/graphql/types/Fund/campaigns.ts | 5 +--- src/graphql/types/Fund/createdAt.ts | 5 +--- src/graphql/types/Fund/creator.ts | 6 +--- src/graphql/types/Fund/organization.ts | 3 +- src/graphql/types/Fund/updatedAt.ts | 5 +--- src/graphql/types/Fund/updater.ts | 6 +--- src/graphql/types/FundCampaign/createdAt.ts | 6 +--- src/graphql/types/FundCampaign/creator.ts | 7 +---- src/graphql/types/FundCampaign/fund.ts | 3 +- .../types/FundCampaign/pledgedAmount.ts | 3 +- src/graphql/types/FundCampaign/pledges.ts | 5 +--- src/graphql/types/FundCampaign/updatedAt.ts | 6 +--- src/graphql/types/FundCampaign/updater.ts | 7 +---- .../types/FundCampaignPledge/campaign.ts | 3 +- .../types/FundCampaignPledge/createdAt.ts | 6 +--- .../types/FundCampaignPledge/creator.ts | 7 +---- .../types/FundCampaignPledge/pledger.ts | 7 +---- .../types/FundCampaignPledge/updatedAt.ts | 6 +--- .../types/FundCampaignPledge/updater.ts | 7 +---- .../types/Mutation/createAdvertisement.ts | 11 +------ .../types/Mutation/createAgendaFolder.ts | 15 +--------- .../types/Mutation/createAgendaItem.ts | 11 +------ src/graphql/types/Mutation/createChat.ts | 9 +----- .../types/Mutation/createChatMembership.ts | 13 +-------- .../types/Mutation/createChatMessage.ts | 11 +------ src/graphql/types/Mutation/createComment.ts | 9 +----- .../types/Mutation/createCommentVote.ts | 11 +------ src/graphql/types/Mutation/createEvent.ts | 9 +----- src/graphql/types/Mutation/createFund.ts | 11 +------ .../types/Mutation/createFundCampaign.ts | 11 +------ .../Mutation/createFundCampaignPledge.ts | 23 +-------------- .../types/Mutation/createOrganization.ts | 9 +----- .../Mutation/createOrganizationMembership.ts | 13 +-------- src/graphql/types/Mutation/createPost.ts | 11 +------ src/graphql/types/Mutation/createPostVote.ts | 11 +------ src/graphql/types/Mutation/createTag.ts | 15 +--------- src/graphql/types/Mutation/createTagFolder.ts | 15 ++-------- src/graphql/types/Mutation/createUser.ts | 9 +----- src/graphql/types/Mutation/createVenue.ts | 11 +------ .../types/Mutation/createVenueBooking.ts | 13 +-------- .../types/Mutation/deleteAdvertisement.ts | 9 +----- .../types/Mutation/deleteAgendaFolder.ts | 9 +----- .../types/Mutation/deleteAgendaItem.ts | 9 +----- src/graphql/types/Mutation/deleteChat.ts | 9 +----- .../types/Mutation/deleteChatMembership.ts | 12 +------- .../types/Mutation/deleteChatMessage.ts | 9 +----- src/graphql/types/Mutation/deleteComment.ts | 9 +----- .../types/Mutation/deleteCommentVote.ts | 12 +------- .../types/Mutation/deleteCurrentUser.ts | 5 +--- src/graphql/types/Mutation/deleteEvent.ts | 9 +----- src/graphql/types/Mutation/deleteFund.ts | 9 +----- .../types/Mutation/deleteFundCampaign.ts | 9 +----- .../Mutation/deleteFundCampaignPledge.ts | 9 +----- .../types/Mutation/deleteOrganization.ts | 9 +----- .../Mutation/deleteOrganizationMembership.ts | 12 +------- src/graphql/types/Mutation/deletePost.ts | 9 +----- src/graphql/types/Mutation/deletePostVote.ts | 16 +--------- src/graphql/types/Mutation/deleteTag.ts | 9 +----- src/graphql/types/Mutation/deleteTagFolder.ts | 9 +----- src/graphql/types/Mutation/deleteUser.ts | 11 +------ src/graphql/types/Mutation/deleteVenue.ts | 9 +----- .../types/Mutation/deleteVenueBooking.ts | 12 +------- src/graphql/types/Mutation/signUp.ts | 7 +---- .../types/Mutation/updateAdvertisement.ts | 13 +-------- .../types/Mutation/updateAgendaFolder.ts | 15 +--------- .../types/Mutation/updateAgendaItem.ts | 23 +-------------- src/graphql/types/Mutation/updateChat.ts | 9 +----- .../types/Mutation/updateChatMembership.ts | 12 +------- .../types/Mutation/updateChatMessage.ts | 9 +----- src/graphql/types/Mutation/updateComment.ts | 9 +----- .../types/Mutation/updateCommentVote.ts | 9 +----- .../types/Mutation/updateCurrentUser.ts | 8 +---- src/graphql/types/Mutation/updateEvent.ts | 11 +------ src/graphql/types/Mutation/updateFund.ts | 11 +------ .../types/Mutation/updateFundCampaign.ts | 13 +-------- .../Mutation/updateFundCampaignPledge.ts | 9 +----- .../types/Mutation/updateOrganization.ts | 9 +----- .../Mutation/updateOrganizationMembership.ts | 12 +------- src/graphql/types/Mutation/updatePost.ts | 17 +---------- src/graphql/types/Mutation/updatePostVote.ts | 9 +----- src/graphql/types/Mutation/updateTag.ts | 15 +--------- src/graphql/types/Mutation/updateTagFolder.ts | 13 +-------- src/graphql/types/Mutation/updateUser.ts | 11 +------ src/graphql/types/Mutation/updateVenue.ts | 11 +------ .../types/Organization/advertisements.ts | 8 +---- src/graphql/types/Organization/chats.ts | 5 +--- src/graphql/types/Organization/creator.ts | 4 +-- src/graphql/types/Organization/events.ts | 8 +---- src/graphql/types/Organization/funds.ts | 5 +--- src/graphql/types/Organization/members.ts | 5 +--- src/graphql/types/Organization/pinnedPosts.ts | 8 +---- src/graphql/types/Organization/posts.ts | 8 +---- src/graphql/types/Organization/tagFolders.ts | 8 +---- src/graphql/types/Organization/tags.ts | 8 +---- src/graphql/types/Organization/updatedAt.ts | 5 +--- src/graphql/types/Organization/updater.ts | 7 +---- src/graphql/types/Organization/venues.ts | 8 +---- src/graphql/types/Post/comments.ts | 6 +--- src/graphql/types/Post/creator.ts | 3 +- src/graphql/types/Post/downVoters.ts | 5 +--- src/graphql/types/Post/organization.ts | 3 +- src/graphql/types/Post/upVoters.ts | 5 +--- src/graphql/types/Post/updater.ts | 6 +--- src/graphql/types/Query/advertisement.ts | 8 +---- src/graphql/types/Query/agendaFolder.ts | 8 +---- src/graphql/types/Query/agendaItem.ts | 8 +---- src/graphql/types/Query/chat.ts | 8 +---- src/graphql/types/Query/chatMessage.ts | 8 +---- src/graphql/types/Query/comment.ts | 8 +---- src/graphql/types/Query/currentUser.ts | 4 +-- src/graphql/types/Query/event.ts | 8 +---- src/graphql/types/Query/fund.ts | 8 +---- src/graphql/types/Query/fundCampaign.ts | 8 +---- src/graphql/types/Query/fundCampaignPledge.ts | 8 +---- src/graphql/types/Query/organization.ts | 4 +-- src/graphql/types/Query/post.ts | 8 +---- .../types/Query/renewAuthenticationToken.ts | 4 +-- src/graphql/types/Query/signIn.ts | 6 +--- src/graphql/types/Query/tag.ts | 8 +---- src/graphql/types/Query/tagFolder.ts | 8 +---- src/graphql/types/Query/user.ts | 4 +-- src/graphql/types/Query/venue.ts | 8 +---- .../types/Subscription/chatMessageCreate.ts | 4 +-- src/graphql/types/Tag/createdAt.ts | 5 +--- src/graphql/types/Tag/creator.ts | 6 +--- src/graphql/types/Tag/folder.ts | 6 +--- src/graphql/types/Tag/organization.ts | 3 +- src/graphql/types/Tag/updatedAt.ts | 5 +--- src/graphql/types/Tag/updater.ts | 6 +--- src/graphql/types/TagFolder/childFolders.ts | 5 +--- src/graphql/types/TagFolder/creator.ts | 3 +- src/graphql/types/TagFolder/organization.ts | 3 +- src/graphql/types/TagFolder/parentFolder.ts | 3 +- src/graphql/types/TagFolder/tags.ts | 5 +--- src/graphql/types/TagFolder/updater.ts | 3 +- src/graphql/types/User/creator.ts | 6 +--- .../types/User/organizationsWhereMember.ts | 5 +--- src/graphql/types/User/updatedAt.ts | 5 +--- src/graphql/types/User/updater.ts | 6 +--- src/graphql/types/Venue/createdAt.ts | 5 +--- src/graphql/types/Venue/creator.ts | 6 +--- src/graphql/types/Venue/events.ts | 8 +---- src/graphql/types/Venue/organization.ts | 3 +- src/graphql/types/Venue/updatedAt.ts | 5 +--- src/graphql/types/Venue/updater.ts | 6 +--- ...aGraphQLError.ts => TalawaGraphQLError.ts} | 29 ++++++++++++++++--- .../graphql/Mutation/createUser.test.ts | 2 +- .../Mutation/deleteCurrentUser.test.ts | 2 +- .../graphql/Mutation/deleteUser.test.ts | 2 +- test/routes/graphql/Mutation/signUp.test.ts | 2 +- .../Mutation/updateCurrentUser.test.ts | 2 +- .../graphql/Mutation/updateUser.test.ts | 2 +- test/routes/graphql/Query/currentUser.test.ts | 2 +- .../Query/renewAuthenticationToken.test.ts | 2 +- test/routes/graphql/Query/signIn.test.ts | 2 +- test/routes/graphql/Query/user.test.ts | 2 +- test/routes/graphql/User/creator.test.ts | 2 +- test/routes/graphql/User/updatedAt.test.ts | 2 +- test/routes/graphql/User/updater.test.ts | 2 +- 203 files changed, 237 insertions(+), 1242 deletions(-) rename src/utilities/{talawaGraphQLError.ts => TalawaGraphQLError.ts} (87%) diff --git a/docs/docs/tutorial-basics/_category_.json b/docs/docs/tutorial-basics/_category_.json index 2e6db55b1e..b1635d4f94 100644 --- a/docs/docs/tutorial-basics/_category_.json +++ b/docs/docs/tutorial-basics/_category_.json @@ -1,8 +1,8 @@ { - "label": "Tutorial - Basics", - "position": 2, - "link": { - "type": "generated-index", - "description": "5 minutes to learn the most important Docusaurus concepts." - } + "label": "Tutorial - Basics", + "position": 2, + "link": { + "type": "generated-index", + "description": "5 minutes to learn the most important Docusaurus concepts." + } } diff --git a/docs/docs/tutorial-extras/_category_.json b/docs/docs/tutorial-extras/_category_.json index a8ffcc1930..dd453eda31 100644 --- a/docs/docs/tutorial-extras/_category_.json +++ b/docs/docs/tutorial-extras/_category_.json @@ -1,7 +1,7 @@ { - "label": "Tutorial - Extras", - "position": 3, - "link": { - "type": "generated-index" - } + "label": "Tutorial - Extras", + "position": 3, + "link": { + "type": "generated-index" + } } diff --git a/src/graphql/types/Advertisement/createdAt.ts b/src/graphql/types/Advertisement/createdAt.ts index a6b4aeda75..1a33d5fb4a 100644 --- a/src/graphql/types/Advertisement/createdAt.ts +++ b/src/graphql/types/Advertisement/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Advertisement } from "./Advertisement"; Advertisement.implement({ @@ -11,7 +11,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Advertisement.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Advertisement/creator.ts b/src/graphql/types/Advertisement/creator.ts index 79f1f7f99f..9d844d70f7 100644 --- a/src/graphql/types/Advertisement/creator.ts +++ b/src/graphql/types/Advertisement/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Advertisement } from "./Advertisement"; Advertisement.implement({ @@ -12,7 +12,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Advertisement.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -82,7 +79,6 @@ Advertisement.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Advertisement/organization.ts b/src/graphql/types/Advertisement/organization.ts index 00dcf4f0ce..47520957ba 100644 --- a/src/graphql/types/Advertisement/organization.ts +++ b/src/graphql/types/Advertisement/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Advertisement } from "./Advertisement"; Advertisement.implement({ @@ -23,7 +23,6 @@ Advertisement.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Advertisement/updatedAt.ts b/src/graphql/types/Advertisement/updatedAt.ts index 13e12bc303..2f58f03a01 100644 --- a/src/graphql/types/Advertisement/updatedAt.ts +++ b/src/graphql/types/Advertisement/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Advertisement } from "./Advertisement"; Advertisement.implement({ @@ -11,7 +11,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Advertisement.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Advertisement/updater.ts b/src/graphql/types/Advertisement/updater.ts index a722edfef9..25e3dff44f 100644 --- a/src/graphql/types/Advertisement/updater.ts +++ b/src/graphql/types/Advertisement/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Advertisement } from "./Advertisement"; Advertisement.implement({ @@ -12,7 +12,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Advertisement.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Advertisement.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -81,7 +78,6 @@ Advertisement.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/AgendaFolder/childFolders.ts b/src/graphql/types/AgendaFolder/childFolders.ts index 94b8b8bd17..a2efe339be 100644 --- a/src/graphql/types/AgendaFolder/childFolders.ts +++ b/src/graphql/types/AgendaFolder/childFolders.ts @@ -4,12 +4,12 @@ import { agendaFoldersTable, agendaFoldersTableInsertSchema, } from "~/src/drizzle/tables/agendaFolders"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; const childFoldersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -68,7 +68,6 @@ AgendaFolder.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -153,8 +152,6 @@ AgendaFolder.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/AgendaFolder/createdAt.ts b/src/graphql/types/AgendaFolder/createdAt.ts index c128281a34..6562f47776 100644 --- a/src/graphql/types/AgendaFolder/createdAt.ts +++ b/src/graphql/types/AgendaFolder/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ @@ -11,7 +11,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -55,7 +54,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -69,7 +67,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -86,7 +83,6 @@ AgendaFolder.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/AgendaFolder/creator.ts b/src/graphql/types/AgendaFolder/creator.ts index 7196037706..c5d337d1ce 100644 --- a/src/graphql/types/AgendaFolder/creator.ts +++ b/src/graphql/types/AgendaFolder/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ @@ -12,7 +12,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -53,7 +52,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -67,7 +65,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -84,7 +81,6 @@ AgendaFolder.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -114,7 +110,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/AgendaFolder/event.ts b/src/graphql/types/AgendaFolder/event.ts index 6bf667cad4..03b3975278 100644 --- a/src/graphql/types/AgendaFolder/event.ts +++ b/src/graphql/types/AgendaFolder/event.ts @@ -1,5 +1,5 @@ import { Event } from "~/src/graphql/types/Event/Event"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ @@ -12,7 +12,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +53,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -68,7 +66,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -85,7 +82,6 @@ AgendaFolder.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/AgendaFolder/items.ts b/src/graphql/types/AgendaFolder/items.ts index 3e9b6d3521..399027bc18 100644 --- a/src/graphql/types/AgendaFolder/items.ts +++ b/src/graphql/types/AgendaFolder/items.ts @@ -5,12 +5,12 @@ import { agendaItemsTableInsertSchema, } from "~/src/drizzle/tables/agendaItems"; import { AgendaItem } from "~/src/graphql/types/AgendaItem/AgendaItem"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; const itemsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -69,7 +69,6 @@ AgendaFolder.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -154,8 +153,6 @@ AgendaFolder.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/AgendaFolder/parentFolder.ts b/src/graphql/types/AgendaFolder/parentFolder.ts index 3e7842091d..99982b36f2 100644 --- a/src/graphql/types/AgendaFolder/parentFolder.ts +++ b/src/graphql/types/AgendaFolder/parentFolder.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ @@ -12,7 +12,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -56,7 +55,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -70,7 +68,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -87,7 +84,6 @@ AgendaFolder.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -113,7 +109,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/AgendaFolder/updatedAt.ts b/src/graphql/types/AgendaFolder/updatedAt.ts index 0afabc78d0..51a9ae431c 100644 --- a/src/graphql/types/AgendaFolder/updatedAt.ts +++ b/src/graphql/types/AgendaFolder/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ @@ -11,7 +11,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -55,7 +54,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -69,7 +67,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -86,7 +83,6 @@ AgendaFolder.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/AgendaFolder/updater.ts b/src/graphql/types/AgendaFolder/updater.ts index 3f704a0079..22bf428ac6 100644 --- a/src/graphql/types/AgendaFolder/updater.ts +++ b/src/graphql/types/AgendaFolder/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ @@ -12,7 +12,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -53,7 +52,6 @@ AgendaFolder.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -67,7 +65,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -84,7 +81,6 @@ AgendaFolder.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -114,7 +110,6 @@ AgendaFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/AgendaItem/createdAt.ts b/src/graphql/types/AgendaItem/createdAt.ts index 9fd6d441a7..dc4f67729c 100644 --- a/src/graphql/types/AgendaItem/createdAt.ts +++ b/src/graphql/types/AgendaItem/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaItem } from "./AgendaItem"; AgendaItem.implement({ @@ -11,7 +11,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -62,7 +61,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -76,7 +74,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -93,7 +90,6 @@ AgendaItem.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/AgendaItem/creator.ts b/src/graphql/types/AgendaItem/creator.ts index 734794632e..cb5398708a 100644 --- a/src/graphql/types/AgendaItem/creator.ts +++ b/src/graphql/types/AgendaItem/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaItem } from "./AgendaItem"; AgendaItem.implement({ @@ -12,7 +12,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -60,7 +59,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +72,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -91,7 +88,6 @@ AgendaItem.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -121,7 +117,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/AgendaItem/folder.ts b/src/graphql/types/AgendaItem/folder.ts index a3744198d7..7296ef1581 100644 --- a/src/graphql/types/AgendaItem/folder.ts +++ b/src/graphql/types/AgendaItem/folder.ts @@ -1,5 +1,5 @@ import { AgendaFolder } from "~/src/graphql/types/AgendaFolder/AgendaFolder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaItem } from "./AgendaItem"; AgendaItem.implement({ @@ -12,7 +12,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -60,7 +59,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +72,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -91,7 +88,6 @@ AgendaItem.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/AgendaItem/updatedAt.ts b/src/graphql/types/AgendaItem/updatedAt.ts index 3cf180ed32..82a8f30ea7 100644 --- a/src/graphql/types/AgendaItem/updatedAt.ts +++ b/src/graphql/types/AgendaItem/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaItem } from "./AgendaItem"; AgendaItem.implement({ @@ -11,7 +11,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -59,7 +58,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -73,7 +71,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -90,7 +87,6 @@ AgendaItem.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/AgendaItem/updater.ts b/src/graphql/types/AgendaItem/updater.ts index 093479c17c..c9348393dc 100644 --- a/src/graphql/types/AgendaItem/updater.ts +++ b/src/graphql/types/AgendaItem/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { AgendaItem } from "./AgendaItem"; AgendaItem.implement({ @@ -12,7 +12,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -60,7 +59,6 @@ AgendaItem.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +72,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -91,7 +88,6 @@ AgendaItem.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -121,7 +117,6 @@ AgendaItem.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Chat/createdAt.ts b/src/graphql/types/Chat/createdAt.ts index f0fadb1574..9e228ed447 100644 --- a/src/graphql/types/Chat/createdAt.ts +++ b/src/graphql/types/Chat/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Chat } from "./Chat"; Chat.implement({ @@ -11,7 +11,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -45,7 +44,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -65,7 +63,6 @@ Chat.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Chat/creator.ts b/src/graphql/types/Chat/creator.ts index ade3230514..8f814a3554 100644 --- a/src/graphql/types/Chat/creator.ts +++ b/src/graphql/types/Chat/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Chat } from "./Chat"; Chat.implement({ @@ -12,7 +12,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -43,7 +42,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -63,7 +61,6 @@ Chat.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -92,7 +89,6 @@ Chat.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Chat/members.ts b/src/graphql/types/Chat/members.ts index edc8125972..afe9b8d43d 100644 --- a/src/graphql/types/Chat/members.ts +++ b/src/graphql/types/Chat/members.ts @@ -5,12 +5,12 @@ import { chatMembershipsTableInsertSchema, } from "~/src/drizzle/tables/chatMemberships"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Chat } from "./Chat"; const membersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -73,7 +73,6 @@ Chat.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -172,8 +171,6 @@ Chat.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Chat/messages.ts b/src/graphql/types/Chat/messages.ts index b409e3a5c1..3a2e97c0d3 100644 --- a/src/graphql/types/Chat/messages.ts +++ b/src/graphql/types/Chat/messages.ts @@ -5,12 +5,12 @@ import { chatMessagesTableInsertSchema, } from "~/src/drizzle/tables/chatMessages"; import { ChatMessage } from "~/src/graphql/types/ChatMessage/ChatMessage"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Chat } from "./Chat"; const messagesArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -65,7 +65,6 @@ Chat.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -136,8 +135,6 @@ Chat.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Chat/organization.ts b/src/graphql/types/Chat/organization.ts index b2942312ef..bc012a37f9 100644 --- a/src/graphql/types/Chat/organization.ts +++ b/src/graphql/types/Chat/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Chat } from "./Chat"; Chat.implement({ @@ -23,7 +23,6 @@ Chat.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Chat/updatedAt.ts b/src/graphql/types/Chat/updatedAt.ts index 308ef07175..7fe6949c7f 100644 --- a/src/graphql/types/Chat/updatedAt.ts +++ b/src/graphql/types/Chat/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Chat } from "./Chat"; Chat.implement({ @@ -11,7 +11,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -45,7 +44,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -65,7 +63,6 @@ Chat.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Chat/updater.ts b/src/graphql/types/Chat/updater.ts index 3313d3c6a7..f2a428e343 100644 --- a/src/graphql/types/Chat/updater.ts +++ b/src/graphql/types/Chat/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Chat } from "./Chat"; Chat.implement({ @@ -12,7 +12,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -43,7 +42,6 @@ Chat.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -63,7 +61,6 @@ Chat.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -92,7 +89,6 @@ Chat.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/ChatMessage/chat.ts b/src/graphql/types/ChatMessage/chat.ts index c5ff190d0c..0ccdd48428 100644 --- a/src/graphql/types/ChatMessage/chat.ts +++ b/src/graphql/types/ChatMessage/chat.ts @@ -1,5 +1,5 @@ import { Chat } from "~/src/graphql/types/Chat/Chat"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { ChatMessage } from "./ChatMessage"; ChatMessage.implement({ @@ -24,7 +24,6 @@ ChatMessage.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/ChatMessage/creator.ts b/src/graphql/types/ChatMessage/creator.ts index 802a406514..89138b1fd5 100644 --- a/src/graphql/types/ChatMessage/creator.ts +++ b/src/graphql/types/ChatMessage/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { ChatMessage } from "./ChatMessage"; ChatMessage.implement({ @@ -29,7 +29,6 @@ ChatMessage.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/ChatMessage/parentChatMessage.ts b/src/graphql/types/ChatMessage/parentChatMessage.ts index e9202b385b..f4b74989fc 100644 --- a/src/graphql/types/ChatMessage/parentChatMessage.ts +++ b/src/graphql/types/ChatMessage/parentChatMessage.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { ChatMessage } from "./ChatMessage"; ChatMessage.implement({ @@ -28,7 +28,6 @@ ChatMessage.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Comment/creator.ts b/src/graphql/types/Comment/creator.ts index 14eab5e579..e0e74c6924 100644 --- a/src/graphql/types/Comment/creator.ts +++ b/src/graphql/types/Comment/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -29,7 +29,6 @@ Comment.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Comment/downVoters.ts b/src/graphql/types/Comment/downVoters.ts index 86179523bb..d97c2e994d 100644 --- a/src/graphql/types/Comment/downVoters.ts +++ b/src/graphql/types/Comment/downVoters.ts @@ -17,12 +17,12 @@ import { commentVotesTableInsertSchema, } from "~/src/drizzle/tables/commentVotes"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Comment } from "./Comment"; const downVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -78,7 +78,6 @@ Comment.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -188,8 +187,6 @@ Comment.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Comment/downVotesCount.ts b/src/graphql/types/Comment/downVotesCount.ts index 8803b1a883..65c501c068 100644 --- a/src/graphql/types/Comment/downVotesCount.ts +++ b/src/graphql/types/Comment/downVotesCount.ts @@ -1,6 +1,6 @@ import { and, count, eq } from "drizzle-orm"; import { commentVotesTable } from "~/src/drizzle/tables/commentVotes"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -30,7 +30,6 @@ Comment.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Comment/post.ts b/src/graphql/types/Comment/post.ts index 02d10c64d1..06b6918831 100644 --- a/src/graphql/types/Comment/post.ts +++ b/src/graphql/types/Comment/post.ts @@ -1,5 +1,5 @@ import { Post } from "~/src/graphql/types/Post/Post"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -27,7 +27,6 @@ Comment.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Comment/upVoters.ts b/src/graphql/types/Comment/upVoters.ts index d0ff4ae67f..fad9fc3875 100644 --- a/src/graphql/types/Comment/upVoters.ts +++ b/src/graphql/types/Comment/upVoters.ts @@ -17,12 +17,12 @@ import { commentVotesTableInsertSchema, } from "~/src/drizzle/tables/commentVotes"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Comment } from "./Comment"; const upVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -78,7 +78,6 @@ Comment.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -188,8 +187,6 @@ Comment.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Comment/upVotesCount.ts b/src/graphql/types/Comment/upVotesCount.ts index b8c3396a5b..9772b76e6b 100644 --- a/src/graphql/types/Comment/upVotesCount.ts +++ b/src/graphql/types/Comment/upVotesCount.ts @@ -1,6 +1,6 @@ import { and, count, eq } from "drizzle-orm"; import { commentVotesTable } from "~/src/drizzle/tables/commentVotes"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -30,7 +30,6 @@ Comment.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Comment/updater.ts b/src/graphql/types/Comment/updater.ts index 52fcb90737..c8360848e0 100644 --- a/src/graphql/types/Comment/updater.ts +++ b/src/graphql/types/Comment/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -12,7 +12,6 @@ Comment.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -53,7 +52,6 @@ Comment.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -66,7 +64,6 @@ Comment.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -82,7 +79,6 @@ Comment.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -111,7 +107,6 @@ Comment.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Event/agendaFolders.ts b/src/graphql/types/Event/agendaFolders.ts index b6676c14ff..deabc8f93b 100644 --- a/src/graphql/types/Event/agendaFolders.ts +++ b/src/graphql/types/Event/agendaFolders.ts @@ -16,12 +16,12 @@ import { agendaFoldersTableInsertSchema, } from "~/src/drizzle/tables/agendaFolders"; import { AgendaFolder } from "~/src/graphql/types/AgendaFolder/AgendaFolder"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Event } from "./Event"; const agendaFoldersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -80,7 +80,6 @@ Event.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -175,8 +174,6 @@ Event.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Event/createdAt.ts b/src/graphql/types/Event/createdAt.ts index 6f54fb7ddc..18fdf800db 100644 --- a/src/graphql/types/Event/createdAt.ts +++ b/src/graphql/types/Event/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Event } from "./Event"; Event.implement({ @@ -11,7 +11,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Event.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Event/creator.ts b/src/graphql/types/Event/creator.ts index 2b66ac9a42..d808d989c4 100644 --- a/src/graphql/types/Event/creator.ts +++ b/src/graphql/types/Event/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Event } from "./Event"; Event.implement({ @@ -12,7 +12,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Event.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -82,7 +79,6 @@ Event.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Event/organization.ts b/src/graphql/types/Event/organization.ts index f1bf00dc72..c5122aa690 100644 --- a/src/graphql/types/Event/organization.ts +++ b/src/graphql/types/Event/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Event } from "./Event"; Event.implement({ @@ -23,7 +23,6 @@ Event.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Event/updatedAt.ts b/src/graphql/types/Event/updatedAt.ts index 6fd70f6646..4cd75f1e9b 100644 --- a/src/graphql/types/Event/updatedAt.ts +++ b/src/graphql/types/Event/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Event } from "./Event"; Event.implement({ @@ -11,7 +11,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Event.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Event/updater.ts b/src/graphql/types/Event/updater.ts index 7233472f7f..1d2d287757 100644 --- a/src/graphql/types/Event/updater.ts +++ b/src/graphql/types/Event/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Event } from "./Event"; Event.implement({ @@ -12,7 +12,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Event.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -81,7 +78,6 @@ Event.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Event/venues.ts b/src/graphql/types/Event/venues.ts index d9f51e3ea3..b8d0a010be 100644 --- a/src/graphql/types/Event/venues.ts +++ b/src/graphql/types/Event/venues.ts @@ -5,12 +5,12 @@ import { venueBookingsTableInsertSchema, } from "~/src/drizzle/tables/venueBookings"; import { Venue } from "~/src/graphql/types/Venue/Venue"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Event } from "./Event"; const venuesArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -59,7 +59,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -78,7 +77,6 @@ Event.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -104,7 +102,6 @@ Event.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ Event.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -219,8 +215,6 @@ Event.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Fund/campaigns.ts b/src/graphql/types/Fund/campaigns.ts index 587c945b1b..f010ea8d84 100644 --- a/src/graphql/types/Fund/campaigns.ts +++ b/src/graphql/types/Fund/campaigns.ts @@ -5,12 +5,12 @@ import { fundCampaignsTableInsertSchema, } from "~/src/drizzle/tables/fundCampaigns"; import { FundCampaign } from "~/src/graphql/types/FundCampaign/FundCampaign"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Fund } from "./Fund"; const campaignsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -65,7 +65,6 @@ Fund.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -135,8 +134,6 @@ Fund.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Fund/createdAt.ts b/src/graphql/types/Fund/createdAt.ts index f17a4355bf..63f5dfad17 100644 --- a/src/graphql/types/Fund/createdAt.ts +++ b/src/graphql/types/Fund/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Fund } from "./Fund"; Fund.implement({ @@ -11,7 +11,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Fund.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Fund/creator.ts b/src/graphql/types/Fund/creator.ts index a5712f42b0..4c87d4c18d 100644 --- a/src/graphql/types/Fund/creator.ts +++ b/src/graphql/types/Fund/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Fund } from "./Fund"; Fund.implement({ @@ -12,7 +12,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Fund.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -81,7 +78,6 @@ Fund.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Fund/organization.ts b/src/graphql/types/Fund/organization.ts index 5a9607c4f5..702c947d9e 100644 --- a/src/graphql/types/Fund/organization.ts +++ b/src/graphql/types/Fund/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Fund } from "./Fund"; Fund.implement({ @@ -23,7 +23,6 @@ Fund.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Fund/updatedAt.ts b/src/graphql/types/Fund/updatedAt.ts index 9e5a339bb8..f84de6b689 100644 --- a/src/graphql/types/Fund/updatedAt.ts +++ b/src/graphql/types/Fund/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Fund } from "./Fund"; Fund.implement({ @@ -11,7 +11,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Fund.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Fund/updater.ts b/src/graphql/types/Fund/updater.ts index 45a7b583ab..c536cfff5b 100644 --- a/src/graphql/types/Fund/updater.ts +++ b/src/graphql/types/Fund/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Fund } from "./Fund"; Fund.implement({ @@ -12,7 +12,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Fund.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Fund.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -81,7 +78,6 @@ Fund.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaign/createdAt.ts b/src/graphql/types/FundCampaign/createdAt.ts index ba5401cae2..7e122c979e 100644 --- a/src/graphql/types/FundCampaign/createdAt.ts +++ b/src/graphql/types/FundCampaign/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -11,7 +11,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -56,7 +55,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -69,7 +67,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -85,7 +82,6 @@ FundCampaign.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/FundCampaign/creator.ts b/src/graphql/types/FundCampaign/creator.ts index 6b9288d368..8da5269666 100644 --- a/src/graphql/types/FundCampaign/creator.ts +++ b/src/graphql/types/FundCampaign/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -12,7 +12,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -53,7 +52,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -66,7 +64,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -82,7 +79,6 @@ FundCampaign.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -111,7 +107,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaign/fund.ts b/src/graphql/types/FundCampaign/fund.ts index 19bc395691..c82e7f248f 100644 --- a/src/graphql/types/FundCampaign/fund.ts +++ b/src/graphql/types/FundCampaign/fund.ts @@ -1,5 +1,5 @@ import { Fund } from "~/src/graphql/types/Fund/Fund"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -24,7 +24,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaign/pledgedAmount.ts b/src/graphql/types/FundCampaign/pledgedAmount.ts index 1adcfd0870..9045c8a16c 100644 --- a/src/graphql/types/FundCampaign/pledgedAmount.ts +++ b/src/graphql/types/FundCampaign/pledgedAmount.ts @@ -1,6 +1,6 @@ import { eq, sum } from "drizzle-orm"; import { fundCampaignPledgesTable } from "~/src/drizzle/tables/fundCampaignPledges"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -25,7 +25,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaign/pledges.ts b/src/graphql/types/FundCampaign/pledges.ts index db3327d77d..e1b46f679e 100644 --- a/src/graphql/types/FundCampaign/pledges.ts +++ b/src/graphql/types/FundCampaign/pledges.ts @@ -5,12 +5,12 @@ import { fundCampaignPledgesTableInsertSchema, } from "~/src/drizzle/tables/fundCampaignPledges"; import { FundCampaignPledge } from "~/src/graphql/types/FundCampaignPledge/FundCampaignPledge"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; const pledgesArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -65,7 +65,6 @@ FundCampaign.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -136,8 +135,6 @@ FundCampaign.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/FundCampaign/updatedAt.ts b/src/graphql/types/FundCampaign/updatedAt.ts index 99fda3d5c2..f72d70d684 100644 --- a/src/graphql/types/FundCampaign/updatedAt.ts +++ b/src/graphql/types/FundCampaign/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -11,7 +11,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -56,7 +55,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -69,7 +67,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -85,7 +82,6 @@ FundCampaign.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/FundCampaign/updater.ts b/src/graphql/types/FundCampaign/updater.ts index e52ab547cf..c6fc334b91 100644 --- a/src/graphql/types/FundCampaign/updater.ts +++ b/src/graphql/types/FundCampaign/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -12,7 +12,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -53,7 +52,6 @@ FundCampaign.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -66,7 +64,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -82,7 +79,6 @@ FundCampaign.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -111,7 +107,6 @@ FundCampaign.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaignPledge/campaign.ts b/src/graphql/types/FundCampaignPledge/campaign.ts index 7ba7586614..2ae781ae4d 100644 --- a/src/graphql/types/FundCampaignPledge/campaign.ts +++ b/src/graphql/types/FundCampaignPledge/campaign.ts @@ -1,5 +1,5 @@ import { FundCampaign } from "~/src/graphql/types/FundCampaign/FundCampaign"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaignPledge } from "./FundCampaignPledge"; FundCampaignPledge.implement({ @@ -24,7 +24,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaignPledge/createdAt.ts b/src/graphql/types/FundCampaignPledge/createdAt.ts index 351bda7131..362a6dad8e 100644 --- a/src/graphql/types/FundCampaignPledge/createdAt.ts +++ b/src/graphql/types/FundCampaignPledge/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaignPledge } from "./FundCampaignPledge"; FundCampaignPledge.implement({ @@ -12,7 +12,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -64,7 +63,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -78,7 +76,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -95,7 +92,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/FundCampaignPledge/creator.ts b/src/graphql/types/FundCampaignPledge/creator.ts index 98d5a61800..eaa17bcbc4 100644 --- a/src/graphql/types/FundCampaignPledge/creator.ts +++ b/src/graphql/types/FundCampaignPledge/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaignPledge } from "./FundCampaignPledge"; FundCampaignPledge.implement({ @@ -12,7 +12,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -60,7 +59,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +72,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -91,7 +88,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -121,7 +117,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaignPledge/pledger.ts b/src/graphql/types/FundCampaignPledge/pledger.ts index f2222bd24a..5248c70b74 100644 --- a/src/graphql/types/FundCampaignPledge/pledger.ts +++ b/src/graphql/types/FundCampaignPledge/pledger.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaignPledge } from "./FundCampaignPledge"; FundCampaignPledge.implement({ @@ -12,7 +12,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -60,7 +59,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +72,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -91,7 +88,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -117,7 +113,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/FundCampaignPledge/updatedAt.ts b/src/graphql/types/FundCampaignPledge/updatedAt.ts index d37bdaca37..7bff93dbea 100644 --- a/src/graphql/types/FundCampaignPledge/updatedAt.ts +++ b/src/graphql/types/FundCampaignPledge/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaignPledge } from "./FundCampaignPledge"; FundCampaignPledge.implement({ @@ -12,7 +12,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -63,7 +62,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -77,7 +75,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -94,7 +91,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/FundCampaignPledge/updater.ts b/src/graphql/types/FundCampaignPledge/updater.ts index 12a1651b34..1ca4a9c30c 100644 --- a/src/graphql/types/FundCampaignPledge/updater.ts +++ b/src/graphql/types/FundCampaignPledge/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaignPledge } from "./FundCampaignPledge"; FundCampaignPledge.implement({ @@ -12,7 +12,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -60,7 +59,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +72,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } @@ -91,7 +88,6 @@ FundCampaignPledge.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -121,7 +117,6 @@ FundCampaignPledge.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Mutation/createAdvertisement.ts b/src/graphql/types/Mutation/createAdvertisement.ts index 262a2190b0..b557258ae8 100644 --- a/src/graphql/types/Mutation/createAdvertisement.ts +++ b/src/graphql/types/Mutation/createAdvertisement.ts @@ -10,7 +10,7 @@ import { mutationCreateAdvertisementInputSchema, } from "~/src/graphql/inputs/MutationCreateAdvertisementInput"; import { Advertisement } from "~/src/graphql/types/Advertisement/Advertisement"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateAdvertisementArgumentsSchema = z.object({ input: mutationCreateAdvertisementInputSchema.transform(async (arg, ctx) => { @@ -72,7 +72,6 @@ builder.mutationField("createAdvertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -91,7 +90,6 @@ builder.mutationField("createAdvertisement", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -139,7 +137,6 @@ builder.mutationField("createAdvertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -153,7 +150,6 @@ builder.mutationField("createAdvertisement", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -171,8 +167,6 @@ builder.mutationField("createAdvertisement", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -193,8 +187,6 @@ builder.mutationField("createAdvertisement", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -222,7 +214,6 @@ builder.mutationField("createAdvertisement", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createAgendaFolder.ts b/src/graphql/types/Mutation/createAgendaFolder.ts index fb9734426d..033c071a92 100644 --- a/src/graphql/types/Mutation/createAgendaFolder.ts +++ b/src/graphql/types/Mutation/createAgendaFolder.ts @@ -6,8 +6,8 @@ import { mutationCreateAgendaFolderInputSchema, } from "~/src/graphql/inputs/MutationCreateAgendaFolderInput"; import { AgendaFolder } from "~/src/graphql/types/AgendaFolder/AgendaFolder"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateAgendaFolderArgumentsSchema = z.object({ input: mutationCreateAgendaFolderInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("createAgendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("createAgendaFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -91,7 +89,6 @@ builder.mutationField("createAgendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -105,7 +102,6 @@ builder.mutationField("createAgendaFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,8 +124,6 @@ builder.mutationField("createAgendaFolder", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -150,8 +144,6 @@ builder.mutationField("createAgendaFolder", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -167,8 +159,6 @@ builder.mutationField("createAgendaFolder", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -190,8 +180,6 @@ builder.mutationField("createAgendaFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -216,7 +204,6 @@ builder.mutationField("createAgendaFolder", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createAgendaItem.ts b/src/graphql/types/Mutation/createAgendaItem.ts index c5ee1ca675..19947087f0 100644 --- a/src/graphql/types/Mutation/createAgendaItem.ts +++ b/src/graphql/types/Mutation/createAgendaItem.ts @@ -6,7 +6,7 @@ import { mutationCreateAgendaItemInputSchema, } from "~/src/graphql/inputs/MutationCreateAgendaItemInput"; import { AgendaItem } from "~/src/graphql/types/AgendaItem/AgendaItem"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateAgendaItemArgumentsSchema = z.object({ input: mutationCreateAgendaItemInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createAgendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createAgendaItem", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -97,7 +95,6 @@ builder.mutationField("createAgendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -111,7 +108,6 @@ builder.mutationField("createAgendaItem", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -127,8 +123,6 @@ builder.mutationField("createAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -150,8 +144,6 @@ builder.mutationField("createAgendaItem", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -178,7 +170,6 @@ builder.mutationField("createAgendaItem", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createChat.ts b/src/graphql/types/Mutation/createChat.ts index 2ad7d98c98..2b004231c9 100644 --- a/src/graphql/types/Mutation/createChat.ts +++ b/src/graphql/types/Mutation/createChat.ts @@ -9,8 +9,8 @@ import { mutationCreateChatInputSchema, } from "~/src/graphql/inputs/MutationCreateChatInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateChatArgumentsSchema = z.object({ input: mutationCreateChatInputSchema.transform(async (arg, ctx) => { @@ -64,7 +64,6 @@ builder.mutationField("createChat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -83,7 +82,6 @@ builder.mutationField("createChat", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -119,7 +117,6 @@ builder.mutationField("createChat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -133,7 +130,6 @@ builder.mutationField("createChat", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -154,8 +150,6 @@ builder.mutationField("createChat", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -189,7 +183,6 @@ builder.mutationField("createChat", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createChatMembership.ts b/src/graphql/types/Mutation/createChatMembership.ts index 7e39704f0f..8fa4d741cb 100644 --- a/src/graphql/types/Mutation/createChatMembership.ts +++ b/src/graphql/types/Mutation/createChatMembership.ts @@ -6,8 +6,8 @@ import { mutationCreateChatMembershipInputSchema, } from "~/src/graphql/inputs/MutationCreateChatMembershipInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { getKeyPathsWithNonUndefinedValues } from "~/src/utilities/getKeyPathsWithNonUndefinedValues"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateChatMembershipArgumentsSchema = z.object({ input: mutationCreateChatMembershipInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("createChatMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("createChatMembership", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -103,7 +101,6 @@ builder.mutationField("createChatMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -120,7 +117,6 @@ builder.mutationField("createChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -134,7 +130,6 @@ builder.mutationField("createChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -148,7 +143,6 @@ builder.mutationField("createChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -170,8 +164,6 @@ builder.mutationField("createChatMembership", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -196,8 +188,6 @@ builder.mutationField("createChatMembership", (t) => argumentPath, })), }, - message: - "You are not authorized to perform this action with the provided arguments.", }); } } @@ -224,7 +214,6 @@ builder.mutationField("createChatMembership", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createChatMessage.ts b/src/graphql/types/Mutation/createChatMessage.ts index 73a58a032f..5f0168b5fa 100644 --- a/src/graphql/types/Mutation/createChatMessage.ts +++ b/src/graphql/types/Mutation/createChatMessage.ts @@ -6,7 +6,7 @@ import { mutationCreateChatMessageInputSchema, } from "~/src/graphql/inputs/MutationCreateChatMessageInput"; import { ChatMessage } from "~/src/graphql/types/ChatMessage/ChatMessage"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateChatMessageArgumentsSchema = z.object({ input: mutationCreateChatMessageInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createChatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createChatMessage", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -97,7 +95,6 @@ builder.mutationField("createChatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -111,7 +108,6 @@ builder.mutationField("createChatMessage", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -140,8 +136,6 @@ builder.mutationField("createChatMessage", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } } @@ -166,8 +160,6 @@ builder.mutationField("createChatMessage", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -187,7 +179,6 @@ builder.mutationField("createChatMessage", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createComment.ts b/src/graphql/types/Mutation/createComment.ts index 1f8f53f737..7f67d6d055 100644 --- a/src/graphql/types/Mutation/createComment.ts +++ b/src/graphql/types/Mutation/createComment.ts @@ -6,7 +6,7 @@ import { mutationCreateCommentInputSchema, } from "~/src/graphql/inputs/MutationCreateCommentInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateCommentArgumentsSchema = z.object({ input: mutationCreateCommentInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createComment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createComment", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -90,7 +88,6 @@ builder.mutationField("createComment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -104,7 +101,6 @@ builder.mutationField("createComment", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -124,8 +120,6 @@ builder.mutationField("createComment", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -147,7 +141,6 @@ builder.mutationField("createComment", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createCommentVote.ts b/src/graphql/types/Mutation/createCommentVote.ts index 7a4b1845e9..a3feded070 100644 --- a/src/graphql/types/Mutation/createCommentVote.ts +++ b/src/graphql/types/Mutation/createCommentVote.ts @@ -6,7 +6,7 @@ import { mutationCreateCommentVoteInputSchema, } from "~/src/graphql/inputs/MutationCreateCommentVoteInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateCommentVoteArgumentsSchema = z.object({ input: mutationCreateCommentVoteInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createCommentVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createCommentVote", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -103,7 +101,6 @@ builder.mutationField("createCommentVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -117,7 +114,6 @@ builder.mutationField("createCommentVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -132,8 +128,6 @@ builder.mutationField("createCommentVote", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } const currentUserOrganizationMembership = @@ -153,8 +147,6 @@ builder.mutationField("createCommentVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -176,7 +168,6 @@ builder.mutationField("createCommentVote", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createEvent.ts b/src/graphql/types/Mutation/createEvent.ts index ce3953fc2a..ef951437f4 100644 --- a/src/graphql/types/Mutation/createEvent.ts +++ b/src/graphql/types/Mutation/createEvent.ts @@ -10,7 +10,7 @@ import { mutationCreateEventInputSchema, } from "~/src/graphql/inputs/MutationCreateEventInput"; import { Event } from "~/src/graphql/types/Event/Event"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateEventArgumentsSchema = z.object({ input: mutationCreateEventInputSchema.transform(async (arg, ctx) => { @@ -72,7 +72,6 @@ builder.mutationField("createEvent", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -91,7 +90,6 @@ builder.mutationField("createEvent", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -127,7 +125,6 @@ builder.mutationField("createEvent", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -141,7 +138,6 @@ builder.mutationField("createEvent", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -162,8 +158,6 @@ builder.mutationField("createEvent", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -190,7 +184,6 @@ builder.mutationField("createEvent", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createFund.ts b/src/graphql/types/Mutation/createFund.ts index a1053330ab..d0b52b3471 100644 --- a/src/graphql/types/Mutation/createFund.ts +++ b/src/graphql/types/Mutation/createFund.ts @@ -6,7 +6,7 @@ import { mutationCreateFundInputSchema, } from "~/src/graphql/inputs/MutationCreateFundInput"; import { Fund } from "~/src/graphql/types/Fund/Fund"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateFundArgumentsSchema = z.object({ input: mutationCreateFundInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createFund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createFund", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -90,7 +88,6 @@ builder.mutationField("createFund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -104,7 +101,6 @@ builder.mutationField("createFund", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -122,8 +118,6 @@ builder.mutationField("createFund", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -144,8 +138,6 @@ builder.mutationField("createFund", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -168,7 +160,6 @@ builder.mutationField("createFund", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createFundCampaign.ts b/src/graphql/types/Mutation/createFundCampaign.ts index 59a7d362a9..5c428e8947 100644 --- a/src/graphql/types/Mutation/createFundCampaign.ts +++ b/src/graphql/types/Mutation/createFundCampaign.ts @@ -6,7 +6,7 @@ import { mutationCreateFundCampaignInputSchema, } from "~/src/graphql/inputs/MutationCreateFundCampaignInput"; import { FundCampaign } from "~/src/graphql/types/FundCampaign/FundCampaign"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateFundCampaignArgumentsSchema = z.object({ input: mutationCreateFundCampaignInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createFundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createFundCampaign", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -97,7 +95,6 @@ builder.mutationField("createFundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -111,7 +108,6 @@ builder.mutationField("createFundCampaign", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -129,8 +125,6 @@ builder.mutationField("createFundCampaign", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -151,8 +145,6 @@ builder.mutationField("createFundCampaign", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -178,7 +170,6 @@ builder.mutationField("createFundCampaign", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createFundCampaignPledge.ts b/src/graphql/types/Mutation/createFundCampaignPledge.ts index 839324d25e..9ca10c1bef 100644 --- a/src/graphql/types/Mutation/createFundCampaignPledge.ts +++ b/src/graphql/types/Mutation/createFundCampaignPledge.ts @@ -7,7 +7,7 @@ import { mutationCreateFundCampaignPledgeInputSchema, } from "~/src/graphql/inputs/MutationCreateFundCampaignPledgeInput"; import { FundCampaignPledge } from "~/src/graphql/types/FundCampaignPledge/FundCampaignPledge"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateFundCampaignPledgeArgumentsSchema = z.object({ input: mutationCreateFundCampaignPledgeInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("createFundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("createFundCampaignPledge", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -116,7 +114,6 @@ builder.mutationField("createFundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -133,7 +130,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -147,7 +143,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -161,7 +156,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -184,8 +178,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -200,8 +192,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -216,8 +206,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -244,8 +232,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } else { @@ -259,8 +245,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -280,8 +264,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } else { @@ -295,8 +277,6 @@ builder.mutationField("createFundCampaignPledge", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } } @@ -323,7 +303,6 @@ builder.mutationField("createFundCampaignPledge", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createOrganization.ts b/src/graphql/types/Mutation/createOrganization.ts index dbd874db44..9a6e7c37df 100644 --- a/src/graphql/types/Mutation/createOrganization.ts +++ b/src/graphql/types/Mutation/createOrganization.ts @@ -9,8 +9,8 @@ import { mutationCreateOrganizationInputSchema, } from "~/src/graphql/inputs/MutationCreateOrganizationInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateOrganizationArgumentsSchema = z.object({ input: mutationCreateOrganizationInputSchema.transform(async (arg, ctx) => { @@ -64,7 +64,6 @@ builder.mutationField("createOrganization", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -83,7 +82,6 @@ builder.mutationField("createOrganization", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -101,7 +99,6 @@ builder.mutationField("createOrganization", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -110,7 +107,6 @@ builder.mutationField("createOrganization", (t) => extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -131,8 +127,6 @@ builder.mutationField("createOrganization", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -171,7 +165,6 @@ builder.mutationField("createOrganization", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createOrganizationMembership.ts b/src/graphql/types/Mutation/createOrganizationMembership.ts index c22bff6707..a92c76d278 100644 --- a/src/graphql/types/Mutation/createOrganizationMembership.ts +++ b/src/graphql/types/Mutation/createOrganizationMembership.ts @@ -6,8 +6,8 @@ import { mutationCreateOrganizationMembershipInputSchema, } from "~/src/graphql/inputs/MutationCreateOrganizationMembershipInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { getKeyPathsWithNonUndefinedValues } from "~/src/utilities/getKeyPathsWithNonUndefinedValues"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateOrganizationMembershipArgumentsSchema = z.object({ input: mutationCreateOrganizationMembershipInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("createOrganizationMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("createOrganizationMembership", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -97,7 +95,6 @@ builder.mutationField("createOrganizationMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -114,7 +111,6 @@ builder.mutationField("createOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,7 +124,6 @@ builder.mutationField("createOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -142,7 +137,6 @@ builder.mutationField("createOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -162,8 +156,6 @@ builder.mutationField("createOrganizationMembership", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -181,8 +173,6 @@ builder.mutationField("createOrganizationMembership", (t) => argumentPath, })), }, - message: - "You are not authorized to perform this action with the provided arguments.", }); } } @@ -209,7 +199,6 @@ builder.mutationField("createOrganizationMembership", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createPost.ts b/src/graphql/types/Mutation/createPost.ts index 148959766d..c827a5d1bf 100644 --- a/src/graphql/types/Mutation/createPost.ts +++ b/src/graphql/types/Mutation/createPost.ts @@ -10,8 +10,8 @@ import { mutationCreatePostInputSchema, } from "~/src/graphql/inputs/MutationCreatePostInput"; import { Post } from "~/src/graphql/types/Post/Post"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { getKeyPathsWithNonUndefinedValues } from "~/src/utilities/getKeyPathsWithNonUndefinedValues"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreatePostArgumentsSchema = z.object({ input: mutationCreatePostInputSchema.transform(async (arg, ctx) => { @@ -73,7 +73,6 @@ builder.mutationField("createPost", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -92,7 +91,6 @@ builder.mutationField("createPost", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -128,7 +126,6 @@ builder.mutationField("createPost", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -142,7 +139,6 @@ builder.mutationField("createPost", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -160,8 +156,6 @@ builder.mutationField("createPost", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -179,8 +173,6 @@ builder.mutationField("createPost", (t) => argumentPath, })), }, - message: - "You are not authorized to perform this action with the provided arguments.", }); } } @@ -210,7 +202,6 @@ builder.mutationField("createPost", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createPostVote.ts b/src/graphql/types/Mutation/createPostVote.ts index b7402030b6..ef5706cbb5 100644 --- a/src/graphql/types/Mutation/createPostVote.ts +++ b/src/graphql/types/Mutation/createPostVote.ts @@ -6,7 +6,7 @@ import { mutationCreatePostVoteInputSchema, } from "~/src/graphql/inputs/MutationCreatePostVoteInput"; import { Post } from "~/src/graphql/types/Post/Post"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreatePostVoteArgumentsSchema = z.object({ input: mutationCreatePostVoteInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createPostVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createPostVote", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -98,7 +96,6 @@ builder.mutationField("createPostVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -112,7 +109,6 @@ builder.mutationField("createPostVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -127,8 +123,6 @@ builder.mutationField("createPostVote", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } const currentUserOrganizationMembership = @@ -147,8 +141,6 @@ builder.mutationField("createPostVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -170,7 +162,6 @@ builder.mutationField("createPostVote", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createTag.ts b/src/graphql/types/Mutation/createTag.ts index 1cc8b09cfc..6e4f524c74 100644 --- a/src/graphql/types/Mutation/createTag.ts +++ b/src/graphql/types/Mutation/createTag.ts @@ -6,8 +6,8 @@ import { mutationCreateTagInputSchema, } from "~/src/graphql/inputs/MutationCreateTagInput"; import { Tag } from "~/src/graphql/types/Tag/Tag"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateTagArgumentsSchema = z.object({ input: mutationCreateTagInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("createTag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("createTag", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -97,7 +95,6 @@ builder.mutationField("createTag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -111,7 +108,6 @@ builder.mutationField("createTag", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,8 +124,6 @@ builder.mutationField("createTag", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -154,8 +148,6 @@ builder.mutationField("createTag", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -173,8 +165,6 @@ builder.mutationField("createTag", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -196,8 +186,6 @@ builder.mutationField("createTag", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -221,7 +209,6 @@ builder.mutationField("createTag", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createTagFolder.ts b/src/graphql/types/Mutation/createTagFolder.ts index 072bca15d0..42f7bc0ced 100644 --- a/src/graphql/types/Mutation/createTagFolder.ts +++ b/src/graphql/types/Mutation/createTagFolder.ts @@ -6,8 +6,8 @@ import { mutationCreateTagFolderInputSchema, } from "~/src/graphql/inputs/MutationCreateTagFolderInput"; import { TagFolder } from "~/src/graphql/types/TagFolder/TagFolder"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateTagFolderArgumentsSchema = z.object({ input: mutationCreateTagFolderInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("createTagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("createTagFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -84,7 +82,6 @@ builder.mutationField("createTagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -98,7 +95,6 @@ builder.mutationField("createTagFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -124,8 +120,6 @@ builder.mutationField("createTagFolder", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -140,12 +134,10 @@ builder.mutationField("createTagFolder", (t) => { argumentPath: ["input", "parentFolderId"], message: - "This tagFolder does not belong to the associated organization.", + "This tag folder does not belong to the associated organization.", }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -167,8 +159,6 @@ builder.mutationField("createTagFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -192,7 +182,6 @@ builder.mutationField("createTagFolder", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createUser.ts b/src/graphql/types/Mutation/createUser.ts index 4bdcfc73a1..72e7260632 100755 --- a/src/graphql/types/Mutation/createUser.ts +++ b/src/graphql/types/Mutation/createUser.ts @@ -10,8 +10,8 @@ import { mutationCreateUserInputSchema, } from "~/src/graphql/inputs/MutationCreateUserInput"; import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateUserArgumentsSchema = z.object({ input: mutationCreateUserInputSchema.transform(async (arg, ctx) => { @@ -65,7 +65,6 @@ builder.mutationField("createUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -84,7 +83,6 @@ builder.mutationField("createUser", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -111,7 +109,6 @@ builder.mutationField("createUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -120,7 +117,6 @@ builder.mutationField("createUser", (t) => extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -135,8 +131,6 @@ builder.mutationField("createUser", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -187,7 +181,6 @@ builder.mutationField("createUser", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createVenue.ts b/src/graphql/types/Mutation/createVenue.ts index 89b6ac0c28..e00102cf65 100644 --- a/src/graphql/types/Mutation/createVenue.ts +++ b/src/graphql/types/Mutation/createVenue.ts @@ -10,7 +10,7 @@ import { mutationCreateVenueInputSchema, } from "~/src/graphql/inputs/MutationCreateVenueInput"; import { Venue } from "~/src/graphql/types/Venue/Venue"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateVenueArgumentsSchema = z.object({ input: mutationCreateVenueInputSchema.transform(async (arg, ctx) => { @@ -72,7 +72,6 @@ builder.mutationField("createVenue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -91,7 +90,6 @@ builder.mutationField("createVenue", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -134,7 +132,6 @@ builder.mutationField("createVenue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -148,7 +145,6 @@ builder.mutationField("createVenue", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -166,8 +162,6 @@ builder.mutationField("createVenue", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -188,8 +182,6 @@ builder.mutationField("createVenue", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -214,7 +206,6 @@ builder.mutationField("createVenue", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/createVenueBooking.ts b/src/graphql/types/Mutation/createVenueBooking.ts index fea13fd802..980030930b 100644 --- a/src/graphql/types/Mutation/createVenueBooking.ts +++ b/src/graphql/types/Mutation/createVenueBooking.ts @@ -6,7 +6,7 @@ import { mutationCreateVenueBookingInputSchema, } from "~/src/graphql/inputs/MutationCreateVenueBookingInput"; import { Venue } from "~/src/graphql/types/Venue/Venue"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationCreateVenueBookingArgumentsSchema = z.object({ input: mutationCreateVenueBookingInputSchema, @@ -28,7 +28,6 @@ builder.mutationField("createVenueBooking", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.mutationField("createVenueBooking", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -101,7 +99,6 @@ builder.mutationField("createVenueBooking", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -118,7 +115,6 @@ builder.mutationField("createVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -132,7 +128,6 @@ builder.mutationField("createVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -146,7 +141,6 @@ builder.mutationField("createVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -168,8 +162,6 @@ builder.mutationField("createVenueBooking", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -193,8 +185,6 @@ builder.mutationField("createVenueBooking", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -217,7 +207,6 @@ builder.mutationField("createVenueBooking", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteAdvertisement.ts b/src/graphql/types/Mutation/deleteAdvertisement.ts index b7a2585467..056cd0f4b0 100644 --- a/src/graphql/types/Mutation/deleteAdvertisement.ts +++ b/src/graphql/types/Mutation/deleteAdvertisement.ts @@ -7,7 +7,7 @@ import { mutationDeleteAdvertisementInputSchema, } from "~/src/graphql/inputs/MutationDeleteAdvertisementInput"; import { Advertisement } from "~/src/graphql/types/Advertisement/Advertisement"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteAdvertisementArgumentsSchema = z.object({ input: mutationDeleteAdvertisementInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteAdvertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteAdvertisement", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -92,7 +90,6 @@ builder.mutationField("deleteAdvertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -106,7 +103,6 @@ builder.mutationField("deleteAdvertisement", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,8 +124,6 @@ builder.mutationField("deleteAdvertisement", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -145,7 +139,6 @@ builder.mutationField("deleteAdvertisement", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteAgendaFolder.ts b/src/graphql/types/Mutation/deleteAgendaFolder.ts index dacf23d2c1..e0411b161b 100644 --- a/src/graphql/types/Mutation/deleteAgendaFolder.ts +++ b/src/graphql/types/Mutation/deleteAgendaFolder.ts @@ -7,7 +7,7 @@ import { mutationDeleteAgendaFolderInputSchema, } from "~/src/graphql/inputs/MutationDeleteAgendaFolderInput"; import { AgendaFolder } from "~/src/graphql/types/AgendaFolder/AgendaFolder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteAgendaFolderArgumentsSchema = z.object({ input: mutationDeleteAgendaFolderInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteAgendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteAgendaFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -98,7 +96,6 @@ builder.mutationField("deleteAgendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -112,7 +109,6 @@ builder.mutationField("deleteAgendaFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -134,8 +130,6 @@ builder.mutationField("deleteAgendaFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -150,7 +144,6 @@ builder.mutationField("deleteAgendaFolder", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteAgendaItem.ts b/src/graphql/types/Mutation/deleteAgendaItem.ts index cced2b4c62..59e0a16d2b 100644 --- a/src/graphql/types/Mutation/deleteAgendaItem.ts +++ b/src/graphql/types/Mutation/deleteAgendaItem.ts @@ -7,7 +7,7 @@ import { mutationDeleteAgendaItemInputSchema, } from "~/src/graphql/inputs/MutationDeleteAgendaItemInput"; import { AgendaItem } from "~/src/graphql/types/AgendaItem/AgendaItem"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteAgendaItemArgumentsSchema = z.object({ input: mutationDeleteAgendaItemInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteAgendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteAgendaItem", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -105,7 +103,6 @@ builder.mutationField("deleteAgendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("deleteAgendaItem", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -141,8 +137,6 @@ builder.mutationField("deleteAgendaItem", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -157,7 +151,6 @@ builder.mutationField("deleteAgendaItem", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteChat.ts b/src/graphql/types/Mutation/deleteChat.ts index 7bc5c08a4d..c472aa761f 100644 --- a/src/graphql/types/Mutation/deleteChat.ts +++ b/src/graphql/types/Mutation/deleteChat.ts @@ -7,7 +7,7 @@ import { mutationDeleteChatInputSchema, } from "~/src/graphql/inputs/MutationDeleteChatInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteChatArgumentsSchema = z.object({ input: mutationDeleteChatInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteChat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteChat", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -98,7 +96,6 @@ builder.mutationField("deleteChat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -112,7 +109,6 @@ builder.mutationField("deleteChat", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -137,8 +133,6 @@ builder.mutationField("deleteChat", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -154,7 +148,6 @@ builder.mutationField("deleteChat", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteChatMembership.ts b/src/graphql/types/Mutation/deleteChatMembership.ts index b2c06e9cac..15a3c1c1b6 100644 --- a/src/graphql/types/Mutation/deleteChatMembership.ts +++ b/src/graphql/types/Mutation/deleteChatMembership.ts @@ -7,7 +7,7 @@ import { mutationDeleteChatMembershipInputSchema, } from "~/src/graphql/inputs/MutationDeleteChatMembershipInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteChatMembershipArgumentsSchema = z.object({ input: mutationDeleteChatMembershipInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteChatMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteChatMembership", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -106,7 +104,6 @@ builder.mutationField("deleteChatMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -123,7 +120,6 @@ builder.mutationField("deleteChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -137,7 +133,6 @@ builder.mutationField("deleteChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -151,7 +146,6 @@ builder.mutationField("deleteChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -177,7 +171,6 @@ builder.mutationField("deleteChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -204,8 +197,6 @@ builder.mutationField("deleteChatMembership", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -225,7 +216,6 @@ builder.mutationField("deleteChatMembership", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteChatMessage.ts b/src/graphql/types/Mutation/deleteChatMessage.ts index 382fe3b96a..085bbc3869 100644 --- a/src/graphql/types/Mutation/deleteChatMessage.ts +++ b/src/graphql/types/Mutation/deleteChatMessage.ts @@ -7,7 +7,7 @@ import { mutationDeleteChatMessageInputSchema, } from "~/src/graphql/inputs/MutationDeleteChatMessageInput"; import { ChatMessage } from "~/src/graphql/types/ChatMessage/ChatMessage"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteChatMessageArgumentsSchema = z.object({ input: mutationDeleteChatMessageInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteChatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteChatMessage", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -105,7 +103,6 @@ builder.mutationField("deleteChatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("deleteChatMessage", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -146,8 +142,6 @@ builder.mutationField("deleteChatMessage", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -162,7 +156,6 @@ builder.mutationField("deleteChatMessage", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteComment.ts b/src/graphql/types/Mutation/deleteComment.ts index c129495b6d..dfb7523269 100644 --- a/src/graphql/types/Mutation/deleteComment.ts +++ b/src/graphql/types/Mutation/deleteComment.ts @@ -7,7 +7,7 @@ import { mutationDeleteCommentInputSchema, } from "~/src/graphql/inputs/MutationDeleteCommentInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteCommentArgumentsSchema = z.object({ input: mutationDeleteCommentInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteComment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteComment", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -98,7 +96,6 @@ builder.mutationField("deleteComment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -112,7 +109,6 @@ builder.mutationField("deleteComment", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -135,8 +131,6 @@ builder.mutationField("deleteComment", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -151,7 +145,6 @@ builder.mutationField("deleteComment", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteCommentVote.ts b/src/graphql/types/Mutation/deleteCommentVote.ts index 0add1e3438..9f58a5cc40 100644 --- a/src/graphql/types/Mutation/deleteCommentVote.ts +++ b/src/graphql/types/Mutation/deleteCommentVote.ts @@ -7,7 +7,7 @@ import { mutationDeleteCommentVoteInputSchema, } from "~/src/graphql/inputs/MutationDeleteCommentVoteInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteCommentVoteArgumentsSchema = z.object({ input: mutationDeleteCommentVoteInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteCommentVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteCommentVote", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -110,7 +108,6 @@ builder.mutationField("deleteCommentVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -127,7 +124,6 @@ builder.mutationField("deleteCommentVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -141,7 +137,6 @@ builder.mutationField("deleteCommentVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -155,7 +150,6 @@ builder.mutationField("deleteCommentVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -172,7 +166,6 @@ builder.mutationField("deleteCommentVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -198,8 +191,6 @@ builder.mutationField("deleteCommentVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -219,7 +210,6 @@ builder.mutationField("deleteCommentVote", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteCurrentUser.ts b/src/graphql/types/Mutation/deleteCurrentUser.ts index 3cf46bc6ab..3ee19e5f25 100755 --- a/src/graphql/types/Mutation/deleteCurrentUser.ts +++ b/src/graphql/types/Mutation/deleteCurrentUser.ts @@ -2,7 +2,7 @@ import { eq } from "drizzle-orm"; import { usersTable } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; builder.mutationField("deleteCurrentUser", (t) => t.field({ @@ -13,7 +13,6 @@ builder.mutationField("deleteCurrentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -31,7 +30,6 @@ builder.mutationField("deleteCurrentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -47,7 +45,6 @@ builder.mutationField("deleteCurrentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } diff --git a/src/graphql/types/Mutation/deleteEvent.ts b/src/graphql/types/Mutation/deleteEvent.ts index 880eb288e5..80639ebc51 100644 --- a/src/graphql/types/Mutation/deleteEvent.ts +++ b/src/graphql/types/Mutation/deleteEvent.ts @@ -7,7 +7,7 @@ import { mutationDeleteEventInputSchema, } from "~/src/graphql/inputs/MutationDeleteEventInput"; import { Event } from "~/src/graphql/types/Event/Event"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteEventArgumentsSchema = z.object({ input: mutationDeleteEventInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteEvent", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteEvent", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -92,7 +90,6 @@ builder.mutationField("deleteEvent", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -106,7 +103,6 @@ builder.mutationField("deleteEvent", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -127,8 +123,6 @@ builder.mutationField("deleteEvent", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -144,7 +138,6 @@ builder.mutationField("deleteEvent", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteFund.ts b/src/graphql/types/Mutation/deleteFund.ts index 95170f6286..c50cb68539 100644 --- a/src/graphql/types/Mutation/deleteFund.ts +++ b/src/graphql/types/Mutation/deleteFund.ts @@ -7,7 +7,7 @@ import { mutationDeleteFundInputSchema, } from "~/src/graphql/inputs/MutationDeleteFundInput"; import { Fund } from "~/src/graphql/types/Fund/Fund"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteFundArgumentsSchema = z.object({ input: mutationDeleteFundInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteFund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteFund", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -91,7 +89,6 @@ builder.mutationField("deleteFund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -105,7 +102,6 @@ builder.mutationField("deleteFund", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -126,8 +122,6 @@ builder.mutationField("deleteFund", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -142,7 +136,6 @@ builder.mutationField("deleteFund", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteFundCampaign.ts b/src/graphql/types/Mutation/deleteFundCampaign.ts index ec1443c087..fee3d34421 100644 --- a/src/graphql/types/Mutation/deleteFundCampaign.ts +++ b/src/graphql/types/Mutation/deleteFundCampaign.ts @@ -7,7 +7,7 @@ import { mutationDeleteFundCampaignInputSchema, } from "~/src/graphql/inputs/MutationDeleteFundCampaignInput"; import { FundCampaign } from "~/src/graphql/types/FundCampaign/FundCampaign"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteFundCampaignArgumentsSchema = z.object({ input: mutationDeleteFundCampaignInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteFundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteFundCampaign", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -98,7 +96,6 @@ builder.mutationField("deleteFundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -112,7 +109,6 @@ builder.mutationField("deleteFundCampaign", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -134,8 +130,6 @@ builder.mutationField("deleteFundCampaign", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -150,7 +144,6 @@ builder.mutationField("deleteFundCampaign", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteFundCampaignPledge.ts b/src/graphql/types/Mutation/deleteFundCampaignPledge.ts index bacfb7e8a2..733e78b712 100644 --- a/src/graphql/types/Mutation/deleteFundCampaignPledge.ts +++ b/src/graphql/types/Mutation/deleteFundCampaignPledge.ts @@ -7,7 +7,7 @@ import { mutationDeleteFundCampaignPledgeInputSchema, } from "~/src/graphql/inputs/MutationDeleteFundCampaignPledgeInput"; import { FundCampaignPledge } from "~/src/graphql/types/FundCampaignPledge/FundCampaignPledge"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteFundCampaignPledgeArgumentsSchema = z.object({ input: mutationDeleteFundCampaignPledgeInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteFundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteFundCampaignPledge", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -105,7 +103,6 @@ builder.mutationField("deleteFundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("deleteFundCampaignPledge", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -142,8 +138,6 @@ builder.mutationField("deleteFundCampaignPledge", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -158,7 +152,6 @@ builder.mutationField("deleteFundCampaignPledge", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteOrganization.ts b/src/graphql/types/Mutation/deleteOrganization.ts index bcdf4d744b..2b7585da5b 100644 --- a/src/graphql/types/Mutation/deleteOrganization.ts +++ b/src/graphql/types/Mutation/deleteOrganization.ts @@ -7,7 +7,7 @@ import { mutationDeleteOrganizationInputSchema, } from "~/src/graphql/inputs/MutationDeleteOrganizationInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteOrganizationArgumentsSchema = z.object({ input: mutationDeleteOrganizationInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteOrganization", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteOrganization", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -114,7 +112,6 @@ builder.mutationField("deleteOrganization", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -123,7 +120,6 @@ builder.mutationField("deleteOrganization", (t) => extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -137,7 +133,6 @@ builder.mutationField("deleteOrganization", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -158,8 +153,6 @@ builder.mutationField("deleteOrganization", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Mutation/deleteOrganizationMembership.ts b/src/graphql/types/Mutation/deleteOrganizationMembership.ts index c23beb9679..5446581bea 100644 --- a/src/graphql/types/Mutation/deleteOrganizationMembership.ts +++ b/src/graphql/types/Mutation/deleteOrganizationMembership.ts @@ -7,7 +7,7 @@ import { mutationDeleteOrganizationMembershipInputSchema, } from "~/src/graphql/inputs/MutationDeleteOrganizationMembershipInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteOrganizationMembershipArgumentsSchema = z.object({ input: mutationDeleteOrganizationMembershipInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -106,7 +104,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -123,7 +120,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -137,7 +133,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -151,7 +146,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -168,7 +162,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -193,8 +186,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } } @@ -221,7 +212,6 @@ builder.mutationField("deleteOrganizationMembership", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deletePost.ts b/src/graphql/types/Mutation/deletePost.ts index 862aa2dd05..4b1299eab9 100644 --- a/src/graphql/types/Mutation/deletePost.ts +++ b/src/graphql/types/Mutation/deletePost.ts @@ -7,7 +7,7 @@ import { mutationDeletePostInputSchema, } from "~/src/graphql/inputs/MutationDeletePostInput"; import { Post } from "~/src/graphql/types/Post/Post"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeletePostArgumentsSchema = z.object({ input: mutationDeletePostInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deletePost", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deletePost", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -92,7 +90,6 @@ builder.mutationField("deletePost", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -106,7 +103,6 @@ builder.mutationField("deletePost", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,8 +124,6 @@ builder.mutationField("deletePost", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } } @@ -146,7 +140,6 @@ builder.mutationField("deletePost", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deletePostVote.ts b/src/graphql/types/Mutation/deletePostVote.ts index 131c1a2ce4..09eeaab90d 100644 --- a/src/graphql/types/Mutation/deletePostVote.ts +++ b/src/graphql/types/Mutation/deletePostVote.ts @@ -7,7 +7,7 @@ import { mutationDeletePostVoteInputSchema, } from "~/src/graphql/inputs/MutationDeletePostVoteInput"; import { Post } from "~/src/graphql/types/Post/Post"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeletePostVoteArgumentsSchema = z.object({ input: mutationDeletePostVoteInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deletePostVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deletePostVote", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -105,7 +103,6 @@ builder.mutationField("deletePostVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -122,7 +119,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -136,7 +132,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -150,7 +145,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -167,7 +161,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -192,8 +185,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -216,8 +207,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -237,8 +226,6 @@ builder.mutationField("deletePostVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } } @@ -259,7 +246,6 @@ builder.mutationField("deletePostVote", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteTag.ts b/src/graphql/types/Mutation/deleteTag.ts index b426fea370..801b9d1616 100644 --- a/src/graphql/types/Mutation/deleteTag.ts +++ b/src/graphql/types/Mutation/deleteTag.ts @@ -7,7 +7,7 @@ import { mutationDeleteTagInputSchema, } from "~/src/graphql/inputs/MutationDeleteTagInput"; import { Tag } from "~/src/graphql/types/Tag/Tag"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteTagArgumentsSchema = z.object({ input: mutationDeleteTagInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteTag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteTag", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -90,7 +88,6 @@ builder.mutationField("deleteTag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -104,7 +101,6 @@ builder.mutationField("deleteTag", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -125,8 +121,6 @@ builder.mutationField("deleteTag", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -141,7 +135,6 @@ builder.mutationField("deleteTag", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteTagFolder.ts b/src/graphql/types/Mutation/deleteTagFolder.ts index 00fbfb989c..b929d0e3d0 100644 --- a/src/graphql/types/Mutation/deleteTagFolder.ts +++ b/src/graphql/types/Mutation/deleteTagFolder.ts @@ -7,7 +7,7 @@ import { mutationDeleteTagFolderInputSchema, } from "~/src/graphql/inputs/MutationDeleteTagFolderInput"; import { TagFolder } from "~/src/graphql/types/TagFolder/TagFolder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteTagFolderArgumentsSchema = z.object({ input: mutationDeleteTagFolderInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteTagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteTagFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -90,7 +88,6 @@ builder.mutationField("deleteTagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -104,7 +101,6 @@ builder.mutationField("deleteTagFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -126,8 +122,6 @@ builder.mutationField("deleteTagFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -142,7 +136,6 @@ builder.mutationField("deleteTagFolder", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteUser.ts b/src/graphql/types/Mutation/deleteUser.ts index f83739585d..e8923b8dac 100755 --- a/src/graphql/types/Mutation/deleteUser.ts +++ b/src/graphql/types/Mutation/deleteUser.ts @@ -5,7 +5,7 @@ import { builder } from "~/src/graphql/builder"; import { MutationDeleteUserInput } from "~/src/graphql/inputs/MutationDeleteUserInput"; import { mutationDeleteUserInputSchema } from "~/src/graphql/inputs/MutationDeleteUserInput"; import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteUserArgumentsSchema = z.object({ input: mutationDeleteUserInputSchema, @@ -27,7 +27,6 @@ builder.mutationField("deleteUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.mutationField("deleteUser", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -73,7 +71,6 @@ builder.mutationField("deleteUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -82,7 +79,6 @@ builder.mutationField("deleteUser", (t) => extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -96,7 +92,6 @@ builder.mutationField("deleteUser", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -112,8 +107,6 @@ builder.mutationField("deleteUser", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -134,8 +127,6 @@ builder.mutationField("deleteUser", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Mutation/deleteVenue.ts b/src/graphql/types/Mutation/deleteVenue.ts index 3b35bc9bbd..8351fa50fb 100644 --- a/src/graphql/types/Mutation/deleteVenue.ts +++ b/src/graphql/types/Mutation/deleteVenue.ts @@ -7,7 +7,7 @@ import { mutationDeleteVenueInputSchema, } from "~/src/graphql/inputs/MutationDeleteVenueInput"; import { Venue } from "~/src/graphql/types/Venue/Venue"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteVenueArgumentsSchema = z.object({ input: mutationDeleteVenueInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteVenue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteVenue", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -92,7 +90,6 @@ builder.mutationField("deleteVenue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -106,7 +103,6 @@ builder.mutationField("deleteVenue", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -127,8 +123,6 @@ builder.mutationField("deleteVenue", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -144,7 +138,6 @@ builder.mutationField("deleteVenue", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/deleteVenueBooking.ts b/src/graphql/types/Mutation/deleteVenueBooking.ts index 352f102c7f..2372e2366c 100644 --- a/src/graphql/types/Mutation/deleteVenueBooking.ts +++ b/src/graphql/types/Mutation/deleteVenueBooking.ts @@ -7,7 +7,7 @@ import { mutationDeleteVenueBookingInputSchema, } from "~/src/graphql/inputs/MutationDeleteVenueBookingInput"; import { Venue } from "~/src/graphql/types/Venue/Venue"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationDeleteVenueBookingArgumentsSchema = z.object({ input: mutationDeleteVenueBookingInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("deleteVenueBooking", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("deleteVenueBooking", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -102,7 +100,6 @@ builder.mutationField("deleteVenueBooking", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("deleteVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -133,7 +129,6 @@ builder.mutationField("deleteVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -147,7 +142,6 @@ builder.mutationField("deleteVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -166,7 +160,6 @@ builder.mutationField("deleteVenueBooking", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -190,8 +183,6 @@ builder.mutationField("deleteVenueBooking", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -211,7 +202,6 @@ builder.mutationField("deleteVenueBooking", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/signUp.ts b/src/graphql/types/Mutation/signUp.ts index 67f5ca4d59..d3f4d0323c 100755 --- a/src/graphql/types/Mutation/signUp.ts +++ b/src/graphql/types/Mutation/signUp.ts @@ -12,8 +12,8 @@ import { mutationSignUpInputSchema, } from "~/src/graphql/inputs/MutationSignUpInput"; import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationSignUpArgumentsSchema = z.object({ input: mutationSignUpInputSchema.transform(async (arg, ctx) => { @@ -67,7 +67,6 @@ builder.mutationField("signUp", (t) => extensions: { code: "forbidden_action", }, - message: "Only unauthenticated users can perform this action.", }); } @@ -86,7 +85,6 @@ builder.mutationField("signUp", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -106,8 +104,6 @@ builder.mutationField("signUp", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -160,7 +156,6 @@ builder.mutationField("signUp", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateAdvertisement.ts b/src/graphql/types/Mutation/updateAdvertisement.ts index 72d3d50a42..fe77c7fbbd 100644 --- a/src/graphql/types/Mutation/updateAdvertisement.ts +++ b/src/graphql/types/Mutation/updateAdvertisement.ts @@ -7,7 +7,7 @@ import { mutationUpdateAdvertisementInputSchema, } from "~/src/graphql/inputs/MutationUpdateAdvertisementInput"; import { Advertisement } from "~/src/graphql/types/Advertisement/Advertisement"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateAdvertisementArgumentsSchema = z.object({ input: mutationUpdateAdvertisementInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateAdvertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateAdvertisement", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -94,7 +92,6 @@ builder.mutationField("updateAdvertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -108,7 +105,6 @@ builder.mutationField("updateAdvertisement", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -127,7 +123,6 @@ builder.mutationField("updateAdvertisement", (t) => }, ], }, - message: "Invalid arguments provided.", }); } @@ -146,7 +141,6 @@ builder.mutationField("updateAdvertisement", (t) => }, ], }, - message: "Invalid arguments provided.", }); } @@ -179,8 +173,6 @@ builder.mutationField("updateAdvertisement", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -203,8 +195,6 @@ builder.mutationField("updateAdvertisement", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -227,7 +217,6 @@ builder.mutationField("updateAdvertisement", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateAgendaFolder.ts b/src/graphql/types/Mutation/updateAgendaFolder.ts index 5c6987fb37..fa551d12f0 100644 --- a/src/graphql/types/Mutation/updateAgendaFolder.ts +++ b/src/graphql/types/Mutation/updateAgendaFolder.ts @@ -7,8 +7,8 @@ import { mutationUpdateAgendaFolderInputSchema, } from "~/src/graphql/inputs/MutationUpdateAgendaFolderInput"; import { AgendaFolder } from "~/src/graphql/types/AgendaFolder/AgendaFolder"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateAgendaFolderArgumentsSchema = z.object({ input: mutationUpdateAgendaFolderInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updateAgendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updateAgendaFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -99,7 +97,6 @@ builder.mutationField("updateAgendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -113,7 +110,6 @@ builder.mutationField("updateAgendaFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -136,8 +132,6 @@ builder.mutationField("updateAgendaFolder", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -153,8 +147,6 @@ builder.mutationField("updateAgendaFolder", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -170,8 +162,6 @@ builder.mutationField("updateAgendaFolder", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -194,8 +184,6 @@ builder.mutationField("updateAgendaFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -215,7 +203,6 @@ builder.mutationField("updateAgendaFolder", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateAgendaItem.ts b/src/graphql/types/Mutation/updateAgendaItem.ts index b963a10694..97471a0288 100644 --- a/src/graphql/types/Mutation/updateAgendaItem.ts +++ b/src/graphql/types/Mutation/updateAgendaItem.ts @@ -7,8 +7,8 @@ import { mutationUpdateAgendaItemInputSchema, } from "~/src/graphql/inputs/MutationUpdateAgendaItemInput"; import { AgendaItem } from "~/src/graphql/types/AgendaItem/AgendaItem"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateAgendaItemArgumentsSchema = z.object({ input: mutationUpdateAgendaItemInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updateAgendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updateAgendaItem", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -106,7 +104,6 @@ builder.mutationField("updateAgendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -120,7 +117,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -143,8 +139,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -159,8 +153,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -175,8 +167,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -196,8 +186,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -223,8 +211,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -242,8 +228,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -259,8 +243,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -283,8 +265,6 @@ builder.mutationField("updateAgendaItem", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -307,7 +287,6 @@ builder.mutationField("updateAgendaItem", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateChat.ts b/src/graphql/types/Mutation/updateChat.ts index bc43385fdb..b2d980d67b 100644 --- a/src/graphql/types/Mutation/updateChat.ts +++ b/src/graphql/types/Mutation/updateChat.ts @@ -10,8 +10,8 @@ import { mutationUpdateChatInputSchema, } from "~/src/graphql/inputs/MutationUpdateChatInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateChatArgumentsSchema = z.object({ input: mutationUpdateChatInputSchema.transform(async (arg, ctx) => { @@ -67,7 +67,6 @@ builder.mutationField("updateChat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -86,7 +85,6 @@ builder.mutationField("updateChat", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -136,7 +134,6 @@ builder.mutationField("updateChat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -150,7 +147,6 @@ builder.mutationField("updateChat", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -175,8 +171,6 @@ builder.mutationField("updateChat", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -212,7 +206,6 @@ builder.mutationField("updateChat", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateChatMembership.ts b/src/graphql/types/Mutation/updateChatMembership.ts index 18946e2bdf..4837b4f42d 100644 --- a/src/graphql/types/Mutation/updateChatMembership.ts +++ b/src/graphql/types/Mutation/updateChatMembership.ts @@ -7,7 +7,7 @@ import { mutationUpdateChatMembershipInputSchema, } from "~/src/graphql/inputs/MutationUpdateChatMembershipInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateChatMembershipArgumentsSchema = z.object({ input: mutationUpdateChatMembershipInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateChatMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateChatMembership", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -106,7 +104,6 @@ builder.mutationField("updateChatMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -123,7 +120,6 @@ builder.mutationField("updateChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -137,7 +133,6 @@ builder.mutationField("updateChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -151,7 +146,6 @@ builder.mutationField("updateChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -177,7 +171,6 @@ builder.mutationField("updateChatMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -204,8 +197,6 @@ builder.mutationField("updateChatMembership", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -229,7 +220,6 @@ builder.mutationField("updateChatMembership", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateChatMessage.ts b/src/graphql/types/Mutation/updateChatMessage.ts index b485966113..48f8eb08c1 100644 --- a/src/graphql/types/Mutation/updateChatMessage.ts +++ b/src/graphql/types/Mutation/updateChatMessage.ts @@ -7,7 +7,7 @@ import { mutationUpdateChatMessageInputSchema, } from "~/src/graphql/inputs/MutationUpdateChatMessageInput"; import { ChatMessage } from "~/src/graphql/types/ChatMessage/ChatMessage"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateChatMessageArgumentsSchema = z.object({ input: mutationUpdateChatMessageInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateChatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateChatMessage", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -105,7 +103,6 @@ builder.mutationField("updateChatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("updateChatMessage", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -145,8 +141,6 @@ builder.mutationField("updateChatMessage", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -164,7 +158,6 @@ builder.mutationField("updateChatMessage", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateComment.ts b/src/graphql/types/Mutation/updateComment.ts index 96061d2e13..76c5e93b4d 100644 --- a/src/graphql/types/Mutation/updateComment.ts +++ b/src/graphql/types/Mutation/updateComment.ts @@ -7,7 +7,7 @@ import { mutationUpdateCommentInputSchema, } from "~/src/graphql/inputs/MutationUpdateCommentInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateCommentArgumentsSchema = z.object({ input: mutationUpdateCommentInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateComment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateComment", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -98,7 +96,6 @@ builder.mutationField("updateComment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -112,7 +109,6 @@ builder.mutationField("updateComment", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -134,8 +130,6 @@ builder.mutationField("updateComment", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -154,7 +148,6 @@ builder.mutationField("updateComment", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateCommentVote.ts b/src/graphql/types/Mutation/updateCommentVote.ts index 5406b45869..3253d83eb7 100644 --- a/src/graphql/types/Mutation/updateCommentVote.ts +++ b/src/graphql/types/Mutation/updateCommentVote.ts @@ -7,7 +7,7 @@ import { mutationUpdateCommentVoteInputSchema, } from "~/src/graphql/inputs/MutationUpdateCommentVoteInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateCommentVoteArgumentsSchema = z.object({ input: mutationUpdateCommentVoteInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateCommentVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateCommentVote", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -107,7 +105,6 @@ builder.mutationField("updateCommentVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -121,7 +118,6 @@ builder.mutationField("updateCommentVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -142,8 +138,6 @@ builder.mutationField("updateCommentVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -167,7 +161,6 @@ builder.mutationField("updateCommentVote", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateCurrentUser.ts b/src/graphql/types/Mutation/updateCurrentUser.ts index 26f37597ba..d8b866dffb 100755 --- a/src/graphql/types/Mutation/updateCurrentUser.ts +++ b/src/graphql/types/Mutation/updateCurrentUser.ts @@ -11,8 +11,8 @@ import { mutationUpdateCurrentUserInputSchema, } from "~/src/graphql/inputs/MutationUpdateCurrentUserInput"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateCurrentUserArgumentsSchema = z.object({ input: mutationUpdateCurrentUserInputSchema.transform(async (arg, ctx) => { @@ -66,7 +66,6 @@ builder.mutationField("updateCurrentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -85,7 +84,6 @@ builder.mutationField("updateCurrentUser", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -103,7 +101,6 @@ builder.mutationField("updateCurrentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -130,8 +127,6 @@ builder.mutationField("updateCurrentUser", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -186,7 +181,6 @@ builder.mutationField("updateCurrentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } diff --git a/src/graphql/types/Mutation/updateEvent.ts b/src/graphql/types/Mutation/updateEvent.ts index cf0eb5dff5..6db5cbb12c 100644 --- a/src/graphql/types/Mutation/updateEvent.ts +++ b/src/graphql/types/Mutation/updateEvent.ts @@ -7,8 +7,8 @@ import { mutationUpdateEventInputSchema, } from "~/src/graphql/inputs/MutationUpdateEventInput"; import { Event } from "~/src/graphql/types/Event/Event"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateEventArgumentsSchema = z.object({ input: mutationUpdateEventInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updateEvent", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updateEvent", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -95,7 +93,6 @@ builder.mutationField("updateEvent", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -109,7 +106,6 @@ builder.mutationField("updateEvent", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,7 +124,6 @@ builder.mutationField("updateEvent", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -147,7 +142,6 @@ builder.mutationField("updateEvent", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -168,8 +162,6 @@ builder.mutationField("updateEvent", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -191,7 +183,6 @@ builder.mutationField("updateEvent", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateFund.ts b/src/graphql/types/Mutation/updateFund.ts index 10bb833bad..8a09a9b6c5 100644 --- a/src/graphql/types/Mutation/updateFund.ts +++ b/src/graphql/types/Mutation/updateFund.ts @@ -7,7 +7,7 @@ import { mutationUpdateFundInputSchema, } from "~/src/graphql/inputs/MutationUpdateFundInput"; import { Fund } from "~/src/graphql/types/Fund/Fund"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateFundArgumentsSchema = z.object({ input: mutationUpdateFundInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateFund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateFund", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -91,7 +89,6 @@ builder.mutationField("updateFund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -105,7 +102,6 @@ builder.mutationField("updateFund", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -138,8 +134,6 @@ builder.mutationField("updateFund", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -161,8 +155,6 @@ builder.mutationField("updateFund", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -182,7 +174,6 @@ builder.mutationField("updateFund", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateFundCampaign.ts b/src/graphql/types/Mutation/updateFundCampaign.ts index 1810791a44..d70a33fe5e 100644 --- a/src/graphql/types/Mutation/updateFundCampaign.ts +++ b/src/graphql/types/Mutation/updateFundCampaign.ts @@ -7,7 +7,7 @@ import { mutationUpdateFundCampaignInputSchema, } from "~/src/graphql/inputs/MutationUpdateFundCampaignInput"; import { FundCampaign } from "~/src/graphql/types/FundCampaign/FundCampaign"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateFundCampaignArgumentsSchema = z.object({ input: mutationUpdateFundCampaignInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateFundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateFundCampaign", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -100,7 +98,6 @@ builder.mutationField("updateFundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -114,7 +111,6 @@ builder.mutationField("updateFundCampaign", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -133,7 +129,6 @@ builder.mutationField("updateFundCampaign", (t) => }, ], }, - message: "Invalid arguments provided.", }); } @@ -152,7 +147,6 @@ builder.mutationField("updateFundCampaign", (t) => }, ], }, - message: "Invalid arguments provided.", }); } @@ -182,8 +176,6 @@ builder.mutationField("updateFundCampaign", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -206,8 +198,6 @@ builder.mutationField("updateFundCampaign", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -228,7 +218,6 @@ builder.mutationField("updateFundCampaign", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateFundCampaignPledge.ts b/src/graphql/types/Mutation/updateFundCampaignPledge.ts index 31bfeb27ee..7b18d0eb92 100644 --- a/src/graphql/types/Mutation/updateFundCampaignPledge.ts +++ b/src/graphql/types/Mutation/updateFundCampaignPledge.ts @@ -7,7 +7,7 @@ import { mutationUpdateFundCampaignPledgeInputSchema, } from "~/src/graphql/inputs/MutationUpdateFundCampaignPledgeInput"; import { FundCampaignPledge } from "~/src/graphql/types/FundCampaignPledge/FundCampaignPledge"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateFundCampaignPledgeArgumentsSchema = z.object({ input: mutationUpdateFundCampaignPledgeInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateFundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateFundCampaignPledge", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -105,7 +103,6 @@ builder.mutationField("updateFundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("updateFundCampaignPledge", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -142,8 +138,6 @@ builder.mutationField("updateFundCampaignPledge", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -163,7 +157,6 @@ builder.mutationField("updateFundCampaignPledge", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateOrganization.ts b/src/graphql/types/Mutation/updateOrganization.ts index b1a74165c7..56f4c2608f 100644 --- a/src/graphql/types/Mutation/updateOrganization.ts +++ b/src/graphql/types/Mutation/updateOrganization.ts @@ -10,8 +10,8 @@ import { mutationUpdateOrganizationInputSchema, } from "~/src/graphql/inputs/MutationUpdateOrganizationInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateOrganizationArgumentsSchema = z.object({ input: mutationUpdateOrganizationInputSchema.transform(async (arg, ctx) => { @@ -67,7 +67,6 @@ builder.mutationField("updateOrganization", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -86,7 +85,6 @@ builder.mutationField("updateOrganization", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -113,7 +111,6 @@ builder.mutationField("updateOrganization", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -127,7 +124,6 @@ builder.mutationField("updateOrganization", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -136,7 +132,6 @@ builder.mutationField("updateOrganization", (t) => extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -184,8 +179,6 @@ builder.mutationField("updateOrganization", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Mutation/updateOrganizationMembership.ts b/src/graphql/types/Mutation/updateOrganizationMembership.ts index af4e3e9f76..5e18d8d952 100644 --- a/src/graphql/types/Mutation/updateOrganizationMembership.ts +++ b/src/graphql/types/Mutation/updateOrganizationMembership.ts @@ -7,7 +7,7 @@ import { mutationUpdateOrganizationMembershipInputSchema, } from "~/src/graphql/inputs/MutationUpdateOrganizationMembershipInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdateOrganizationMembershipArgumentsSchema = z.object({ input: mutationUpdateOrganizationMembershipInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updateOrganizationMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updateOrganizationMembership", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -107,7 +105,6 @@ builder.mutationField("updateOrganizationMembership", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -124,7 +121,6 @@ builder.mutationField("updateOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -138,7 +134,6 @@ builder.mutationField("updateOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -152,7 +147,6 @@ builder.mutationField("updateOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -169,7 +163,6 @@ builder.mutationField("updateOrganizationMembership", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -193,8 +186,6 @@ builder.mutationField("updateOrganizationMembership", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } } @@ -225,7 +216,6 @@ builder.mutationField("updateOrganizationMembership", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updatePost.ts b/src/graphql/types/Mutation/updatePost.ts index 61a4dfc7c1..c4d59f2077 100644 --- a/src/graphql/types/Mutation/updatePost.ts +++ b/src/graphql/types/Mutation/updatePost.ts @@ -7,8 +7,8 @@ import { mutationUpdatePostInputSchema, } from "~/src/graphql/inputs/MutationUpdatePostInput"; import { Post } from "~/src/graphql/types/Post/Post"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { getKeyPathsWithNonUndefinedValues } from "~/src/utilities/getKeyPathsWithNonUndefinedValues"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdatePostArgumentsSchema = z.object({ input: mutationUpdatePostInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updatePost", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updatePost", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -94,7 +92,6 @@ builder.mutationField("updatePost", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -108,7 +105,6 @@ builder.mutationField("updatePost", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -127,8 +123,6 @@ builder.mutationField("updatePost", (t) => argumentPath, })), }, - message: - "You are not authorized to perform this action with the provided arguments.", }); } } @@ -146,8 +140,6 @@ builder.mutationField("updatePost", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -168,8 +160,6 @@ builder.mutationField("updatePost", (t) => argumentPath, })), }, - message: - "You are not authorized to perform this action with the provided arguments.", }); } } @@ -187,8 +177,6 @@ builder.mutationField("updatePost", (t) => argumentPath, })), }, - message: - "You are not authorized to perform this action with the provided arguments.", }); } @@ -202,8 +190,6 @@ builder.mutationField("updatePost", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } } @@ -232,7 +218,6 @@ builder.mutationField("updatePost", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updatePostVote.ts b/src/graphql/types/Mutation/updatePostVote.ts index e24222f4bf..e1c5623103 100644 --- a/src/graphql/types/Mutation/updatePostVote.ts +++ b/src/graphql/types/Mutation/updatePostVote.ts @@ -7,7 +7,7 @@ import { mutationUpdatePostVoteInputSchema, } from "~/src/graphql/inputs/MutationUpdatePostVoteInput"; import { Post } from "~/src/graphql/types/Post/Post"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const mutationUpdatePostVoteArgumentsSchema = z.object({ input: mutationUpdatePostVoteInputSchema, @@ -29,7 +29,6 @@ builder.mutationField("updatePostVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -48,7 +47,6 @@ builder.mutationField("updatePostVote", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -99,7 +97,6 @@ builder.mutationField("updatePostVote", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -113,7 +110,6 @@ builder.mutationField("updatePostVote", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } const currentUserOrganizationMembership = @@ -132,8 +128,6 @@ builder.mutationField("updatePostVote", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -157,7 +151,6 @@ builder.mutationField("updatePostVote", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateTag.ts b/src/graphql/types/Mutation/updateTag.ts index 1725c96ec6..5e713a7489 100644 --- a/src/graphql/types/Mutation/updateTag.ts +++ b/src/graphql/types/Mutation/updateTag.ts @@ -7,8 +7,8 @@ import { mutationUpdateTagInputSchema, } from "~/src/graphql/inputs/MutationUpdateTagInput"; import { Tag } from "~/src/graphql/types/Tag/Tag"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateTagArgumentsSchema = z.object({ input: mutationUpdateTagInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updateTag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updateTag", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -92,7 +90,6 @@ builder.mutationField("updateTag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -106,7 +103,6 @@ builder.mutationField("updateTag", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -131,8 +127,6 @@ builder.mutationField("updateTag", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -148,8 +142,6 @@ builder.mutationField("updateTag", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -180,8 +172,6 @@ builder.mutationField("updateTag", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -203,8 +193,6 @@ builder.mutationField("updateTag", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -224,7 +212,6 @@ builder.mutationField("updateTag", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateTagFolder.ts b/src/graphql/types/Mutation/updateTagFolder.ts index c4fa7fbccc..2b59d136ab 100644 --- a/src/graphql/types/Mutation/updateTagFolder.ts +++ b/src/graphql/types/Mutation/updateTagFolder.ts @@ -7,8 +7,8 @@ import { mutationUpdateTagFolderInputSchema, } from "~/src/graphql/inputs/MutationUpdateTagFolderInput"; import { TagFolder } from "~/src/graphql/types/TagFolder/TagFolder"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateTagFolderArgumentsSchema = z.object({ input: mutationUpdateTagFolderInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updateTagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updateTagFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -92,7 +90,6 @@ builder.mutationField("updateTagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -106,7 +103,6 @@ builder.mutationField("updateTagFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -132,8 +128,6 @@ builder.mutationField("updateTagFolder", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } @@ -152,8 +146,6 @@ builder.mutationField("updateTagFolder", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -176,8 +168,6 @@ builder.mutationField("updateTagFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -197,7 +187,6 @@ builder.mutationField("updateTagFolder", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Mutation/updateUser.ts b/src/graphql/types/Mutation/updateUser.ts index 6eb38a3add..9c0d8b9e06 100755 --- a/src/graphql/types/Mutation/updateUser.ts +++ b/src/graphql/types/Mutation/updateUser.ts @@ -11,8 +11,8 @@ import { mutationUpdateUserInputSchema, } from "~/src/graphql/inputs/MutationUpdateUserInput"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateUserArgumentsSchema = z.object({ input: mutationUpdateUserInputSchema.transform(async (arg, ctx) => { @@ -66,7 +66,6 @@ builder.mutationField("updateUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -85,7 +84,6 @@ builder.mutationField("updateUser", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -110,7 +108,6 @@ builder.mutationField("updateUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -119,7 +116,6 @@ builder.mutationField("updateUser", (t) => extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -135,8 +131,6 @@ builder.mutationField("updateUser", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } @@ -150,7 +144,6 @@ builder.mutationField("updateUser", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -211,8 +204,6 @@ builder.mutationField("updateUser", (t) => }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Mutation/updateVenue.ts b/src/graphql/types/Mutation/updateVenue.ts index 29f2ea4b29..1e2a8bc8f2 100644 --- a/src/graphql/types/Mutation/updateVenue.ts +++ b/src/graphql/types/Mutation/updateVenue.ts @@ -7,8 +7,8 @@ import { mutationUpdateVenueInputSchema, } from "~/src/graphql/inputs/MutationUpdateVenueInput"; import { Venue } from "~/src/graphql/types/Venue/Venue"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateVenueArgumentsSchema = z.object({ input: mutationUpdateVenueInputSchema, @@ -30,7 +30,6 @@ builder.mutationField("updateVenue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -49,7 +48,6 @@ builder.mutationField("updateVenue", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -93,7 +91,6 @@ builder.mutationField("updateVenue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -107,7 +104,6 @@ builder.mutationField("updateVenue", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -140,8 +136,6 @@ builder.mutationField("updateVenue", (t) => }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", }); } } @@ -163,8 +157,6 @@ builder.mutationField("updateVenue", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } @@ -184,7 +176,6 @@ builder.mutationField("updateVenue", (t) => extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again.", }); } diff --git a/src/graphql/types/Organization/advertisements.ts b/src/graphql/types/Organization/advertisements.ts index 4febed544a..83a41c8b04 100644 --- a/src/graphql/types/Organization/advertisements.ts +++ b/src/graphql/types/Organization/advertisements.ts @@ -5,12 +5,12 @@ import { advertisementsTableInsertSchema, } from "~/src/drizzle/tables/advertisements"; import { Advertisement } from "~/src/graphql/types/Advertisement/Advertisement"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const advertisementsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -55,7 +55,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +73,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -103,7 +101,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -118,7 +115,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -191,8 +187,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/chats.ts b/src/graphql/types/Organization/chats.ts index 785bf300d7..9910f9fd5a 100644 --- a/src/graphql/types/Organization/chats.ts +++ b/src/graphql/types/Organization/chats.ts @@ -2,12 +2,12 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt, or } from "drizzle-orm"; import type { z } from "zod"; import { chatsTable, chatsTableInsertSchema } from "~/src/drizzle/tables/chats"; import { Chat } from "~/src/graphql/types/Chat/Chat"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const chatsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -66,7 +66,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -150,8 +149,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/creator.ts b/src/graphql/types/Organization/creator.ts index ad33736225..86addf74e6 100755 --- a/src/graphql/types/Organization/creator.ts +++ b/src/graphql/types/Organization/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Organization } from "./Organization"; Organization.implement({ @@ -12,7 +12,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Organization.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Organization/events.ts b/src/graphql/types/Organization/events.ts index 7d36dfe2ae..c627761fa6 100644 --- a/src/graphql/types/Organization/events.ts +++ b/src/graphql/types/Organization/events.ts @@ -5,12 +5,12 @@ import { eventsTableInsertSchema, } from "~/src/drizzle/tables/events"; import { Event } from "~/src/graphql/types/Event/Event"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const eventsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -59,7 +59,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -78,7 +77,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -107,7 +105,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -122,7 +119,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -209,8 +205,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/funds.ts b/src/graphql/types/Organization/funds.ts index 6f1630c4b5..7d6fd90f1f 100644 --- a/src/graphql/types/Organization/funds.ts +++ b/src/graphql/types/Organization/funds.ts @@ -2,12 +2,12 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt } from "drizzle-orm"; import type { z } from "zod"; import { fundsTable, fundsTableInsertSchema } from "~/src/drizzle/tables/funds"; import { Fund } from "~/src/graphql/types/Fund/Fund"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const fundsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -62,7 +62,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -131,8 +130,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/members.ts b/src/graphql/types/Organization/members.ts index 97dbe14955..5ec801d959 100644 --- a/src/graphql/types/Organization/members.ts +++ b/src/graphql/types/Organization/members.ts @@ -5,12 +5,12 @@ import { organizationMembershipsTableInsertSchema, } from "~/src/drizzle/tables/organizationMemberships"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const membersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -73,7 +73,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -197,8 +196,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/pinnedPosts.ts b/src/graphql/types/Organization/pinnedPosts.ts index 7850574358..401074747b 100644 --- a/src/graphql/types/Organization/pinnedPosts.ts +++ b/src/graphql/types/Organization/pinnedPosts.ts @@ -14,12 +14,12 @@ import { import { z } from "zod"; import { postsTable, postsTableInsertSchema } from "~/src/drizzle/tables/posts"; import { Post } from "~/src/graphql/types/Post/Post"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const pinnedPostsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -65,7 +65,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -84,7 +83,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -113,7 +111,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -128,7 +125,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -224,8 +220,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/posts.ts b/src/graphql/types/Organization/posts.ts index 7739c9f18e..5819c07c54 100644 --- a/src/graphql/types/Organization/posts.ts +++ b/src/graphql/types/Organization/posts.ts @@ -2,12 +2,12 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt } from "drizzle-orm"; import { z } from "zod"; import { postsTable, postsTableInsertSchema } from "~/src/drizzle/tables/posts"; import { Post } from "~/src/graphql/types/Post/Post"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const postsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -52,7 +52,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -71,7 +70,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -100,7 +98,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -115,7 +112,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -188,8 +184,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/tagFolders.ts b/src/graphql/types/Organization/tagFolders.ts index 02847c81ef..08a0004c7c 100644 --- a/src/graphql/types/Organization/tagFolders.ts +++ b/src/graphql/types/Organization/tagFolders.ts @@ -16,12 +16,12 @@ import { tagFoldersTableInsertSchema, } from "~/src/drizzle/tables/tagFolders"; import { TagFolder } from "~/src/graphql/types/TagFolder/TagFolder"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const tagFoldersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -70,7 +70,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -89,7 +88,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -118,7 +116,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -133,7 +130,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -228,8 +224,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/tags.ts b/src/graphql/types/Organization/tags.ts index 28fa4df336..c475038aa4 100644 --- a/src/graphql/types/Organization/tags.ts +++ b/src/graphql/types/Organization/tags.ts @@ -2,12 +2,12 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt } from "drizzle-orm"; import type { z } from "zod"; import { tagsTable, tagsTableInsertSchema } from "~/src/drizzle/tables/tags"; import { Tag } from "~/src/graphql/types/Tag/Tag"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const tagsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -52,7 +52,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -71,7 +70,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -100,7 +98,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -115,7 +112,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -185,8 +181,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Organization/updatedAt.ts b/src/graphql/types/Organization/updatedAt.ts index c26e3052a0..fe3449d7f9 100644 --- a/src/graphql/types/Organization/updatedAt.ts +++ b/src/graphql/types/Organization/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Organization } from "./Organization"; Organization.implement({ @@ -11,7 +11,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -35,7 +34,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -51,7 +49,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Organization/updater.ts b/src/graphql/types/Organization/updater.ts index 4d09bca368..e912fc2750 100755 --- a/src/graphql/types/Organization/updater.ts +++ b/src/graphql/types/Organization/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Organization } from "./Organization"; Organization.implement({ @@ -12,8 +12,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: - "Only authenticated organizations can perform this action.", }); } @@ -37,7 +35,6 @@ Organization.implement({ extensions: { code: "forbidden_action", }, - message: "Only authenticated users can perform this action.", }); } @@ -53,7 +50,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -83,7 +79,6 @@ Organization.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Organization/venues.ts b/src/graphql/types/Organization/venues.ts index e7c36a3461..a1409a29ec 100644 --- a/src/graphql/types/Organization/venues.ts +++ b/src/graphql/types/Organization/venues.ts @@ -5,12 +5,12 @@ import { venuesTableInsertSchema, } from "~/src/drizzle/tables/venues"; import { Venue } from "~/src/graphql/types/Venue/Venue"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Organization } from "./Organization"; const venuesArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -55,7 +55,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +73,6 @@ Organization.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -103,7 +101,6 @@ Organization.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -118,7 +115,6 @@ Organization.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -191,8 +187,6 @@ Organization.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Post/comments.ts b/src/graphql/types/Post/comments.ts index 23e1267f86..e7fcd7ed4f 100644 --- a/src/graphql/types/Post/comments.ts +++ b/src/graphql/types/Post/comments.ts @@ -5,12 +5,12 @@ import { commentsTableInsertSchema, } from "~/src/drizzle/tables/comments"; import { Comment } from "~/src/graphql/types/Comment/Comment"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Post } from "./Post"; const commentsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -55,7 +55,6 @@ Post.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -74,7 +73,6 @@ Post.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -146,8 +144,6 @@ Post.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Post/creator.ts b/src/graphql/types/Post/creator.ts index 27815a8d2a..6a51489006 100644 --- a/src/graphql/types/Post/creator.ts +++ b/src/graphql/types/Post/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Post } from "./Post"; Post.implement({ @@ -29,7 +29,6 @@ Post.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Post/downVoters.ts b/src/graphql/types/Post/downVoters.ts index b60c38cff6..0a548c92c3 100644 --- a/src/graphql/types/Post/downVoters.ts +++ b/src/graphql/types/Post/downVoters.ts @@ -17,12 +17,12 @@ import { postVotesTableInsertSchema, } from "~/src/drizzle/tables/postVotes"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Post } from "./Post"; const downVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -78,7 +78,6 @@ Post.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -182,8 +181,6 @@ Post.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Post/organization.ts b/src/graphql/types/Post/organization.ts index 8afd746239..63d9d80ac7 100644 --- a/src/graphql/types/Post/organization.ts +++ b/src/graphql/types/Post/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Post } from "./Post"; Post.implement({ @@ -23,7 +23,6 @@ Post.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Post/upVoters.ts b/src/graphql/types/Post/upVoters.ts index b68d7aea6d..054484275b 100644 --- a/src/graphql/types/Post/upVoters.ts +++ b/src/graphql/types/Post/upVoters.ts @@ -17,12 +17,12 @@ import { postVotesTableInsertSchema, } from "~/src/drizzle/tables/postVotes"; import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Post } from "./Post"; const upVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -78,7 +78,6 @@ Post.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -182,8 +181,6 @@ Post.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Post/updater.ts b/src/graphql/types/Post/updater.ts index 03726679d7..9f154596db 100644 --- a/src/graphql/types/Post/updater.ts +++ b/src/graphql/types/Post/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Post } from "./Post"; Post.implement({ @@ -12,7 +12,6 @@ Post.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Post.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Post.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -81,7 +78,6 @@ Post.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Query/advertisement.ts b/src/graphql/types/Query/advertisement.ts index 5961fa91ea..20dee3abeb 100644 --- a/src/graphql/types/Query/advertisement.ts +++ b/src/graphql/types/Query/advertisement.ts @@ -5,7 +5,7 @@ import { queryAdvertisementInputSchema, } from "~/src/graphql/inputs/QueryAdvertisementInput"; import { Advertisement } from "~/src/graphql/types/Advertisement/Advertisement"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryAdvertisementArgumentsSchema = z.object({ input: queryAdvertisementInputSchema, @@ -27,7 +27,6 @@ builder.queryField("advertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("advertisement", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -87,7 +85,6 @@ builder.queryField("advertisement", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -101,7 +98,6 @@ builder.queryField("advertisement", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -122,8 +118,6 @@ builder.queryField("advertisement", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/agendaFolder.ts b/src/graphql/types/Query/agendaFolder.ts index 0ec24493d3..7b34ccbec2 100644 --- a/src/graphql/types/Query/agendaFolder.ts +++ b/src/graphql/types/Query/agendaFolder.ts @@ -5,7 +5,7 @@ import { queryAgendaFolderInputSchema, } from "~/src/graphql/inputs/QueryAgendaFolderInput"; import { AgendaFolder } from "~/src/graphql/types/AgendaFolder/AgendaFolder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryAgendaFolderArgumentsSchema = z.object({ input: queryAgendaFolderInputSchema, @@ -27,7 +27,6 @@ builder.queryField("agendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("agendaFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -93,7 +91,6 @@ builder.queryField("agendaFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -107,7 +104,6 @@ builder.queryField("agendaFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,8 +124,6 @@ builder.queryField("agendaFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/agendaItem.ts b/src/graphql/types/Query/agendaItem.ts index a9b7e8a8e1..bb58be7ccf 100644 --- a/src/graphql/types/Query/agendaItem.ts +++ b/src/graphql/types/Query/agendaItem.ts @@ -5,7 +5,7 @@ import { queryAgendaItemInputSchema, } from "~/src/graphql/inputs/QueryAgendaItemInput"; import { AgendaItem } from "~/src/graphql/types/AgendaItem/AgendaItem"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryAgendaItemArgumentsSchema = z.object({ input: queryAgendaItemInputSchema, @@ -27,7 +27,6 @@ builder.queryField("agendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("agendaItem", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -100,7 +98,6 @@ builder.queryField("agendaItem", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -114,7 +111,6 @@ builder.queryField("agendaItem", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -135,8 +131,6 @@ builder.queryField("agendaItem", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/chat.ts b/src/graphql/types/Query/chat.ts index 4492503e88..9d820ceeca 100644 --- a/src/graphql/types/Query/chat.ts +++ b/src/graphql/types/Query/chat.ts @@ -5,7 +5,7 @@ import { queryChatInputSchema, } from "~/src/graphql/inputs/QueryChatInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryChatArgumentsSchema = z.object({ input: queryChatInputSchema, @@ -27,7 +27,6 @@ builder.queryField("chat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("chat", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -86,7 +84,6 @@ builder.queryField("chat", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -100,7 +97,6 @@ builder.queryField("chat", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -120,8 +116,6 @@ builder.queryField("chat", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/chatMessage.ts b/src/graphql/types/Query/chatMessage.ts index 55186e6047..0f00e07864 100644 --- a/src/graphql/types/Query/chatMessage.ts +++ b/src/graphql/types/Query/chatMessage.ts @@ -5,7 +5,7 @@ import { queryChatMessageInputSchema, } from "~/src/graphql/inputs/QueryChatMessageInput"; import { ChatMessage } from "~/src/graphql/types/ChatMessage/ChatMessage"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryChatArgumentsSchema = z.object({ input: queryChatMessageInputSchema, @@ -27,7 +27,6 @@ builder.queryField("chatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("chatMessage", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -100,7 +98,6 @@ builder.queryField("chatMessage", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -114,7 +111,6 @@ builder.queryField("chatMessage", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -139,8 +135,6 @@ builder.queryField("chatMessage", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/comment.ts b/src/graphql/types/Query/comment.ts index 785fd6494b..0b03a921fa 100644 --- a/src/graphql/types/Query/comment.ts +++ b/src/graphql/types/Query/comment.ts @@ -5,7 +5,7 @@ import { queryCommentInputSchema, } from "~/src/graphql/inputs/QueryCommentInput"; import { Comment } from "~/src/graphql/types/Comment/Comment"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryCommentArgumentsSchema = z.object({ input: queryCommentInputSchema, @@ -27,7 +27,6 @@ builder.queryField("comment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("comment", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -93,7 +91,6 @@ builder.queryField("comment", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -107,7 +104,6 @@ builder.queryField("comment", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -128,8 +124,6 @@ builder.queryField("comment", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/currentUser.ts b/src/graphql/types/Query/currentUser.ts index 11955e5f2d..e2e820e56b 100755 --- a/src/graphql/types/Query/currentUser.ts +++ b/src/graphql/types/Query/currentUser.ts @@ -1,6 +1,6 @@ import { builder } from "~/src/graphql/builder"; import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; builder.queryField("currentUser", (t) => t.field({ @@ -11,7 +11,6 @@ builder.queryField("currentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated organizations can perform this action.", }); } @@ -26,7 +25,6 @@ builder.queryField("currentUser", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } diff --git a/src/graphql/types/Query/event.ts b/src/graphql/types/Query/event.ts index a4d4dd5b16..924276cf94 100644 --- a/src/graphql/types/Query/event.ts +++ b/src/graphql/types/Query/event.ts @@ -5,7 +5,7 @@ import { queryEventInputSchema, } from "~/src/graphql/inputs/QueryEventInput"; import { Event } from "~/src/graphql/types/Event/Event"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryEventArgumentsSchema = z.object({ input: queryEventInputSchema, @@ -27,7 +27,6 @@ builder.queryField("event", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("event", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -87,7 +85,6 @@ builder.queryField("event", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -101,7 +98,6 @@ builder.queryField("event", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -121,8 +117,6 @@ builder.queryField("event", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/fund.ts b/src/graphql/types/Query/fund.ts index c298c08a3c..c44766a31f 100644 --- a/src/graphql/types/Query/fund.ts +++ b/src/graphql/types/Query/fund.ts @@ -5,7 +5,7 @@ import { queryFundInputSchema, } from "~/src/graphql/inputs/QueryFundInput"; import { Fund } from "~/src/graphql/types/Fund/Fund"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryFundArgumentsSchema = z.object({ input: queryFundInputSchema, @@ -27,7 +27,6 @@ builder.queryField("fund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("fund", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -64,7 +62,6 @@ builder.queryField("fund", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -99,7 +96,6 @@ builder.queryField("fund", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -119,8 +115,6 @@ builder.queryField("fund", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/fundCampaign.ts b/src/graphql/types/Query/fundCampaign.ts index 30cdf0488f..d316c88ee5 100644 --- a/src/graphql/types/Query/fundCampaign.ts +++ b/src/graphql/types/Query/fundCampaign.ts @@ -5,7 +5,7 @@ import { queryFundCampaignInputSchema, } from "~/src/graphql/inputs/QueryFundCampaignInput"; import { FundCampaign } from "~/src/graphql/types/FundCampaign/FundCampaign"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryFundCampaignArgumentsSchema = z.object({ input: queryFundCampaignInputSchema, @@ -27,7 +27,6 @@ builder.queryField("fundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("fundCampaign", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -64,7 +62,6 @@ builder.queryField("fundCampaign", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -104,7 +101,6 @@ builder.queryField("fundCampaign", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -125,8 +121,6 @@ builder.queryField("fundCampaign", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/fundCampaignPledge.ts b/src/graphql/types/Query/fundCampaignPledge.ts index 32fc61593f..ea631db46e 100644 --- a/src/graphql/types/Query/fundCampaignPledge.ts +++ b/src/graphql/types/Query/fundCampaignPledge.ts @@ -5,7 +5,7 @@ import { queryFundCampaignPledgeInputSchema, } from "~/src/graphql/inputs/QueryFundCampaignPledgeInput"; import { FundCampaignPledge } from "~/src/graphql/types/FundCampaignPledge/FundCampaignPledge"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryFundCampaignPledgeArgumentsSchema = z.object({ input: queryFundCampaignPledgeInputSchema, @@ -27,7 +27,6 @@ builder.queryField("fundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("fundCampaignPledge", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -64,7 +62,6 @@ builder.queryField("fundCampaignPledge", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -111,7 +108,6 @@ builder.queryField("fundCampaignPledge", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -134,8 +130,6 @@ builder.queryField("fundCampaignPledge", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/organization.ts b/src/graphql/types/Query/organization.ts index 6e2649487b..5cb6930c29 100644 --- a/src/graphql/types/Query/organization.ts +++ b/src/graphql/types/Query/organization.ts @@ -5,7 +5,7 @@ import { queryOrganizationInputSchema, } from "~/src/graphql/inputs/QueryOrganizationInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryOrganizationArgumentsSchema = z.object({ input: queryOrganizationInputSchema, @@ -37,7 +37,6 @@ builder.queryField("organization", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -57,7 +56,6 @@ builder.queryField("organization", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Query/post.ts b/src/graphql/types/Query/post.ts index dbea344cfc..a1de6f7c60 100644 --- a/src/graphql/types/Query/post.ts +++ b/src/graphql/types/Query/post.ts @@ -5,7 +5,7 @@ import { queryPostInputSchema, } from "~/src/graphql/inputs/QueryPostInput"; import { Post } from "~/src/graphql/types/Post/Post"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryPostArgumentsSchema = z.object({ input: queryPostInputSchema, @@ -27,7 +27,6 @@ builder.queryField("post", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("post", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -87,7 +85,6 @@ builder.queryField("post", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -101,7 +98,6 @@ builder.queryField("post", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -121,8 +117,6 @@ builder.queryField("post", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/renewAuthenticationToken.ts b/src/graphql/types/Query/renewAuthenticationToken.ts index 5cacb20b3e..7c22fc5220 100755 --- a/src/graphql/types/Query/renewAuthenticationToken.ts +++ b/src/graphql/types/Query/renewAuthenticationToken.ts @@ -1,5 +1,5 @@ import { builder } from "~/src/graphql/builder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; builder.queryField("renewAuthenticationToken", (t) => t.string({ @@ -11,7 +11,6 @@ builder.queryField("renewAuthenticationToken", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -27,7 +26,6 @@ builder.queryField("renewAuthenticationToken", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } diff --git a/src/graphql/types/Query/signIn.ts b/src/graphql/types/Query/signIn.ts index c2ed412c78..f488ad1f9c 100755 --- a/src/graphql/types/Query/signIn.ts +++ b/src/graphql/types/Query/signIn.ts @@ -6,7 +6,7 @@ import { querySignInInputSchema, } from "~/src/graphql/inputs/QuerySignInInput"; import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const querySignInArgumentsSchema = z.object({ input: querySignInInputSchema, @@ -28,7 +28,6 @@ builder.queryField("signIn", (t) => extensions: { code: "forbidden_action", }, - message: "Only unauthenticated users can perform this action.", }); } @@ -47,7 +46,6 @@ builder.queryField("signIn", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -66,7 +64,6 @@ builder.queryField("signIn", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -83,7 +80,6 @@ builder.queryField("signIn", (t) => }, ], }, - message: "Invalid arguments provided.", }); } diff --git a/src/graphql/types/Query/tag.ts b/src/graphql/types/Query/tag.ts index 4da5769daa..5e6032aebb 100644 --- a/src/graphql/types/Query/tag.ts +++ b/src/graphql/types/Query/tag.ts @@ -5,7 +5,7 @@ import { queryTagInputSchema, } from "~/src/graphql/inputs/QueryTagInput"; import { Tag } from "~/src/graphql/types/Tag/Tag"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryTagArgumentsSchema = z.object({ input: queryTagInputSchema, @@ -27,7 +27,6 @@ builder.queryField("tag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("tag", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -63,7 +61,6 @@ builder.queryField("tag", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -98,7 +95,6 @@ builder.queryField("tag", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -118,8 +114,6 @@ builder.queryField("tag", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/tagFolder.ts b/src/graphql/types/Query/tagFolder.ts index ab32409de0..12b8bfb4c9 100644 --- a/src/graphql/types/Query/tagFolder.ts +++ b/src/graphql/types/Query/tagFolder.ts @@ -5,7 +5,7 @@ import { queryTagFolderInputSchema, } from "~/src/graphql/inputs/QueryTagFolderInput"; import { TagFolder } from "~/src/graphql/types/TagFolder/TagFolder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryTagFolderArgumentsSchema = z.object({ input: queryTagFolderInputSchema, @@ -27,7 +27,6 @@ builder.queryField("tagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("tagFolder", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -63,7 +61,6 @@ builder.queryField("tagFolder", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -99,7 +96,6 @@ builder.queryField("tagFolder", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -121,8 +117,6 @@ builder.queryField("tagFolder", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Query/user.ts b/src/graphql/types/Query/user.ts index 472c031b2b..3bfdd55fdf 100755 --- a/src/graphql/types/Query/user.ts +++ b/src/graphql/types/Query/user.ts @@ -5,7 +5,7 @@ import { queryUserInputSchema, } from "~/src/graphql/inputs/QueryUserInput"; import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryUserArgumentsSchema = z.object({ input: queryUserInputSchema, @@ -37,7 +37,6 @@ builder.queryField("user", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -56,7 +55,6 @@ builder.queryField("user", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Query/venue.ts b/src/graphql/types/Query/venue.ts index 438e03ce90..45b79ee7ab 100644 --- a/src/graphql/types/Query/venue.ts +++ b/src/graphql/types/Query/venue.ts @@ -5,7 +5,7 @@ import { queryVenueInputSchema, } from "~/src/graphql/inputs/QueryVenueInput"; import { Venue } from "~/src/graphql/types/Venue/Venue"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const queryVenueArgumentsSchema = z.object({ input: queryVenueInputSchema, @@ -27,7 +27,6 @@ builder.queryField("venue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -46,7 +45,6 @@ builder.queryField("venue", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -87,7 +85,6 @@ builder.queryField("venue", (t) => extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -101,7 +98,6 @@ builder.queryField("venue", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } @@ -121,8 +117,6 @@ builder.queryField("venue", (t) => }, ], }, - message: - "You are not authorized to perform this action on the resources associated to the provided arguments.", }); } diff --git a/src/graphql/types/Subscription/chatMessageCreate.ts b/src/graphql/types/Subscription/chatMessageCreate.ts index 1935443f6b..c80a5aabe2 100644 --- a/src/graphql/types/Subscription/chatMessageCreate.ts +++ b/src/graphql/types/Subscription/chatMessageCreate.ts @@ -5,7 +5,7 @@ import { subscriptionChatMessageCreateInputSchema, } from "~/src/graphql/inputs/SubscriptionChatMessageCreateInput"; import { ChatMessage } from "~/src/graphql/types/ChatMessage/ChatMessage"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; const subscriptionChatMessageCreateArgumentsSchema = z.object({ input: subscriptionChatMessageCreateInputSchema, @@ -38,7 +38,6 @@ builder.subscriptionField("chatMessageCreate", (t) => message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -60,7 +59,6 @@ builder.subscriptionField("chatMessageCreate", (t) => }, ], }, - message: "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Tag/createdAt.ts b/src/graphql/types/Tag/createdAt.ts index 0dce0cbf05..695742b95f 100644 --- a/src/graphql/types/Tag/createdAt.ts +++ b/src/graphql/types/Tag/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Tag } from "./Tag"; Tag.implement({ @@ -11,7 +11,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Tag.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Tag/creator.ts b/src/graphql/types/Tag/creator.ts index 8d3108739b..493fda1949 100644 --- a/src/graphql/types/Tag/creator.ts +++ b/src/graphql/types/Tag/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Tag } from "./Tag"; Tag.implement({ @@ -12,7 +12,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Tag.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -82,7 +79,6 @@ Tag.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Tag/folder.ts b/src/graphql/types/Tag/folder.ts index 102607b860..b51ce70c20 100644 --- a/src/graphql/types/Tag/folder.ts +++ b/src/graphql/types/Tag/folder.ts @@ -1,5 +1,5 @@ import { TagFolder } from "~/src/graphql/types/TagFolder/TagFolder"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Tag } from "./Tag"; Tag.implement({ @@ -12,7 +12,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Tag.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -77,7 +74,6 @@ Tag.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Tag/organization.ts b/src/graphql/types/Tag/organization.ts index 7efe0bf930..9afcc6cdb0 100644 --- a/src/graphql/types/Tag/organization.ts +++ b/src/graphql/types/Tag/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Tag } from "./Tag"; Tag.implement({ @@ -23,7 +23,6 @@ Tag.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Tag/updatedAt.ts b/src/graphql/types/Tag/updatedAt.ts index f1e1d2ae12..958a2da134 100644 --- a/src/graphql/types/Tag/updatedAt.ts +++ b/src/graphql/types/Tag/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Tag } from "./Tag"; Tag.implement({ @@ -11,7 +11,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Tag.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Tag/updater.ts b/src/graphql/types/Tag/updater.ts index e89e6fa52e..0ca5674e19 100644 --- a/src/graphql/types/Tag/updater.ts +++ b/src/graphql/types/Tag/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Tag } from "./Tag"; Tag.implement({ @@ -12,7 +12,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Tag.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Tag.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -82,7 +79,6 @@ Tag.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/TagFolder/childFolders.ts b/src/graphql/types/TagFolder/childFolders.ts index f35199ce79..a7eb9174f5 100644 --- a/src/graphql/types/TagFolder/childFolders.ts +++ b/src/graphql/types/TagFolder/childFolders.ts @@ -4,12 +4,12 @@ import { tagFoldersTable, tagFoldersTableInsertSchema, } from "~/src/drizzle/tables/tagFolders"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { TagFolder } from "./TagFolder"; const childFoldersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -64,7 +64,6 @@ TagFolder.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -135,8 +134,6 @@ TagFolder.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/TagFolder/creator.ts b/src/graphql/types/TagFolder/creator.ts index 9003709d21..c631624cfa 100644 --- a/src/graphql/types/TagFolder/creator.ts +++ b/src/graphql/types/TagFolder/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { TagFolder } from "./TagFolder"; TagFolder.implement({ @@ -29,7 +29,6 @@ TagFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/TagFolder/organization.ts b/src/graphql/types/TagFolder/organization.ts index 79f5709668..c159b61d6c 100644 --- a/src/graphql/types/TagFolder/organization.ts +++ b/src/graphql/types/TagFolder/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { TagFolder } from "./TagFolder"; TagFolder.implement({ @@ -23,7 +23,6 @@ TagFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/TagFolder/parentFolder.ts b/src/graphql/types/TagFolder/parentFolder.ts index a81262f7e1..f842cc7455 100644 --- a/src/graphql/types/TagFolder/parentFolder.ts +++ b/src/graphql/types/TagFolder/parentFolder.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { TagFolder } from "./TagFolder"; TagFolder.implement({ @@ -28,7 +28,6 @@ TagFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/TagFolder/tags.ts b/src/graphql/types/TagFolder/tags.ts index 00fb88aec2..03f273d771 100644 --- a/src/graphql/types/TagFolder/tags.ts +++ b/src/graphql/types/TagFolder/tags.ts @@ -2,12 +2,12 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt } from "drizzle-orm"; import type { z } from "zod"; import { tagsTable, tagsTableInsertSchema } from "~/src/drizzle/tables/tags"; import { Tag } from "~/src/graphql/types/Tag/Tag"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { TagFolder } from "./TagFolder"; const tagsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -62,7 +62,6 @@ TagFolder.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -132,8 +131,6 @@ TagFolder.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/TagFolder/updater.ts b/src/graphql/types/TagFolder/updater.ts index 066eb792a3..d04916c1d3 100644 --- a/src/graphql/types/TagFolder/updater.ts +++ b/src/graphql/types/TagFolder/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { TagFolder } from "./TagFolder"; TagFolder.implement({ @@ -29,7 +29,6 @@ TagFolder.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/User/creator.ts b/src/graphql/types/User/creator.ts index dfef305e59..05e3729e27 100755 --- a/src/graphql/types/User/creator.ts +++ b/src/graphql/types/User/creator.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { User } from "./User"; User.implement({ @@ -11,7 +11,6 @@ User.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -26,7 +25,6 @@ User.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +36,6 @@ User.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -67,7 +64,6 @@ User.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/User/organizationsWhereMember.ts b/src/graphql/types/User/organizationsWhereMember.ts index 4427eecd44..9499099a56 100644 --- a/src/graphql/types/User/organizationsWhereMember.ts +++ b/src/graphql/types/User/organizationsWhereMember.ts @@ -5,12 +5,12 @@ import { organizationMembershipsTableInsertSchema, } from "~/src/drizzle/tables/organizationMemberships"; import { Organization } from "~/src/graphql/types/Organization/Organization"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { User } from "./User"; const organizationsWhereMemberArgumentsSchema = @@ -74,7 +74,6 @@ User.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -192,8 +191,6 @@ User.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/User/updatedAt.ts b/src/graphql/types/User/updatedAt.ts index c2b309013c..35c7081eb8 100644 --- a/src/graphql/types/User/updatedAt.ts +++ b/src/graphql/types/User/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { User } from "./User"; User.implement({ @@ -11,7 +11,6 @@ User.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -29,7 +28,6 @@ User.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -41,7 +39,6 @@ User.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/User/updater.ts b/src/graphql/types/User/updater.ts index 0c82c68a56..6280af4da9 100755 --- a/src/graphql/types/User/updater.ts +++ b/src/graphql/types/User/updater.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { User } from "./User"; User.implement({ @@ -11,7 +11,6 @@ User.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -26,7 +25,6 @@ User.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +36,6 @@ User.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -68,7 +65,6 @@ User.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Venue/createdAt.ts b/src/graphql/types/Venue/createdAt.ts index 65d2fca18d..7566cb8e5e 100644 --- a/src/graphql/types/Venue/createdAt.ts +++ b/src/graphql/types/Venue/createdAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Venue } from "./Venue"; Venue.implement({ @@ -11,7 +11,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Venue.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Venue/creator.ts b/src/graphql/types/Venue/creator.ts index b7f771dc03..0cfb1f2be9 100644 --- a/src/graphql/types/Venue/creator.ts +++ b/src/graphql/types/Venue/creator.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Venue } from "./Venue"; Venue.implement({ @@ -12,7 +12,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Venue.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -82,7 +79,6 @@ Venue.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Venue/events.ts b/src/graphql/types/Venue/events.ts index c88dd59902..313e2c6367 100644 --- a/src/graphql/types/Venue/events.ts +++ b/src/graphql/types/Venue/events.ts @@ -5,12 +5,12 @@ import { venueBookingsTableInsertSchema, } from "~/src/drizzle/tables/venueBookings"; import { Event } from "~/src/graphql/types/Event/Event"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { defaultGraphQLConnectionArgumentsSchema, transformDefaultGraphQLConnectionArguments, transformToDefaultGraphQLConnection, } from "~/src/utilities/defaultGraphQLConnection"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; import { Venue } from "./Venue"; const eventsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema @@ -59,7 +59,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -78,7 +77,6 @@ Venue.implement({ message: issue.message, })), }, - message: "Invalid arguments provided.", }); } @@ -107,7 +105,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -123,7 +120,6 @@ Venue.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -227,8 +223,6 @@ Venue.implement({ }, ], }, - message: - "No associated resources found for the provided arguments.", }); } diff --git a/src/graphql/types/Venue/organization.ts b/src/graphql/types/Venue/organization.ts index 0c34ecb55d..cc0a51af18 100644 --- a/src/graphql/types/Venue/organization.ts +++ b/src/graphql/types/Venue/organization.ts @@ -1,5 +1,5 @@ import { Organization } from "~/src/graphql/types/Organization/Organization"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Venue } from "./Venue"; Venue.implement({ @@ -23,7 +23,6 @@ Venue.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/graphql/types/Venue/updatedAt.ts b/src/graphql/types/Venue/updatedAt.ts index 5ab8580325..0732c258de 100644 --- a/src/graphql/types/Venue/updatedAt.ts +++ b/src/graphql/types/Venue/updatedAt.ts @@ -1,4 +1,4 @@ -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Venue } from "./Venue"; Venue.implement({ @@ -11,7 +11,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -38,7 +37,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -54,7 +52,6 @@ Venue.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } diff --git a/src/graphql/types/Venue/updater.ts b/src/graphql/types/Venue/updater.ts index f04da802d2..fe69d8f119 100644 --- a/src/graphql/types/Venue/updater.ts +++ b/src/graphql/types/Venue/updater.ts @@ -1,5 +1,5 @@ import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Venue } from "./Venue"; Venue.implement({ @@ -12,7 +12,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -36,7 +35,6 @@ Venue.implement({ extensions: { code: "unauthenticated", }, - message: "Only authenticated users can perform this action.", }); } @@ -52,7 +50,6 @@ Venue.implement({ extensions: { code: "unauthorized_action", }, - message: "You are not authorized to perform this action.", }); } @@ -82,7 +79,6 @@ Venue.implement({ extensions: { code: "unexpected", }, - message: "Something went wrong. Please try again later.", }); } diff --git a/src/utilities/talawaGraphQLError.ts b/src/utilities/TalawaGraphQLError.ts similarity index 87% rename from src/utilities/talawaGraphQLError.ts rename to src/utilities/TalawaGraphQLError.ts index 749d0b0a79..e1c21c8a13 100644 --- a/src/utilities/talawaGraphQLError.ts +++ b/src/utilities/TalawaGraphQLError.ts @@ -84,7 +84,7 @@ export type ForbiddenActionOnArgumentsAssociatedResourcesExtensions = { * extensions: { * code: "unauthenticated" * }, - * message: "Only authenticated users can perform this action.", + * * }) */ export type UnauthenticatedExtensions = { @@ -113,7 +113,7 @@ export type UnauthenticatedExtensions = { * }, * ], * }, - * message: "Invalid arguments provided.", + * * }) */ export type InvalidArgumentsExtensions = { @@ -213,6 +213,24 @@ export type TalawaGraphQLErrorExtensions = | UnauthorizedArgumentsExtensions | UnexpectedExtensions; +export const defaultTalawaGraphQLErrorMessages: { + [Key in TalawaGraphQLErrorExtensions["code"]]: string; +} = { + arguments_associated_resources_not_found: + "No associated resources found for the provided arguments.", + forbidden_action: "This action is forbidden.", + forbidden_action_on_arguments_associated_resources: + "This action is forbidden on the resources associated to the provided arguments.", + invalid_arguments: "You have provided invalid arguments for this action.", + unauthenticated: "You must be authenticated to perform this action.", + unauthorized_action: "You are not authorized to perform this action.", + unauthorized_action_on_arguments_associated_resources: + "You are not authorized to perform this action on the resources associated to the provided arguments.", + unauthorized_arguments: + "You are not authorized to perform this action with the provided arguments.", + unexpected: "Something went wrong. Please try again later.", +}; + /** * This class extends the `GraphQLError` class and is used to create graphql error instances with strict typescript assertion on providing the error metadata within the `extensions` field. This assertion prevents talawa api contributers from returning arbitrary, undocumented errors to the talawa api graphql clients. * @@ -235,7 +253,7 @@ export type TalawaGraphQLErrorExtensions = * }, * ], * }, - * message: "No associated resources found for the provided arguments.", + * * }) * } * @@ -248,8 +266,11 @@ export class TalawaGraphQLError extends GraphQLError { ...options }: GraphQLErrorOptions & { extensions: TalawaGraphQLErrorExtensions; - message: string; + message?: string; }) { + if (message === undefined) { + message = defaultTalawaGraphQLErrorMessages[options.extensions.code]; + } super(message, options); } } diff --git a/test/routes/graphql/Mutation/createUser.test.ts b/test/routes/graphql/Mutation/createUser.test.ts index 8bd8875e52..3bba8c54a2 100644 --- a/test/routes/graphql/Mutation/createUser.test.ts +++ b/test/routes/graphql/Mutation/createUser.test.ts @@ -7,7 +7,7 @@ import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, UnauthorizedActionExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Mutation/deleteCurrentUser.test.ts b/test/routes/graphql/Mutation/deleteCurrentUser.test.ts index 7abbd2e94f..638532f638 100644 --- a/test/routes/graphql/Mutation/deleteCurrentUser.test.ts +++ b/test/routes/graphql/Mutation/deleteCurrentUser.test.ts @@ -3,7 +3,7 @@ import { expect, suite, test } from "vitest"; import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Mutation/deleteUser.test.ts b/test/routes/graphql/Mutation/deleteUser.test.ts index 998057faae..9c607edee3 100644 --- a/test/routes/graphql/Mutation/deleteUser.test.ts +++ b/test/routes/graphql/Mutation/deleteUser.test.ts @@ -7,7 +7,7 @@ import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, UnauthorizedActionExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Mutation/signUp.test.ts b/test/routes/graphql/Mutation/signUp.test.ts index 5b5abc28b6..3e1bb4609e 100644 --- a/test/routes/graphql/Mutation/signUp.test.ts +++ b/test/routes/graphql/Mutation/signUp.test.ts @@ -7,7 +7,7 @@ import type { ForbiddenActionOnArgumentsAssociatedResourcesExtensions, InvalidArgumentsExtensions, TalawaGraphQLFormattedError, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; import { Mutation_signUp, Query_signIn } from "../documentNodes"; diff --git a/test/routes/graphql/Mutation/updateCurrentUser.test.ts b/test/routes/graphql/Mutation/updateCurrentUser.test.ts index 11b789dd37..5d62049128 100644 --- a/test/routes/graphql/Mutation/updateCurrentUser.test.ts +++ b/test/routes/graphql/Mutation/updateCurrentUser.test.ts @@ -6,7 +6,7 @@ import type { InvalidArgumentsExtensions, TalawaGraphQLFormattedError, UnauthenticatedExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Mutation/updateUser.test.ts b/test/routes/graphql/Mutation/updateUser.test.ts index 2e15d614cd..a0b8b70d90 100644 --- a/test/routes/graphql/Mutation/updateUser.test.ts +++ b/test/routes/graphql/Mutation/updateUser.test.ts @@ -8,7 +8,7 @@ import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, UnauthorizedActionExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Query/currentUser.test.ts b/test/routes/graphql/Query/currentUser.test.ts index 1f5f95c5f8..70db71f86b 100644 --- a/test/routes/graphql/Query/currentUser.test.ts +++ b/test/routes/graphql/Query/currentUser.test.ts @@ -3,7 +3,7 @@ import { expect, suite, test } from "vitest"; import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Query/renewAuthenticationToken.test.ts b/test/routes/graphql/Query/renewAuthenticationToken.test.ts index b37075b4d7..3518d092dd 100644 --- a/test/routes/graphql/Query/renewAuthenticationToken.test.ts +++ b/test/routes/graphql/Query/renewAuthenticationToken.test.ts @@ -4,7 +4,7 @@ import { expect, suite, test } from "vitest"; import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/Query/signIn.test.ts b/test/routes/graphql/Query/signIn.test.ts index 90ba60684a..34e5e6aec1 100644 --- a/test/routes/graphql/Query/signIn.test.ts +++ b/test/routes/graphql/Query/signIn.test.ts @@ -6,7 +6,7 @@ import type { ForbiddenActionExtensions, InvalidArgumentsExtensions, TalawaGraphQLFormattedError, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; import { Query_signIn } from "../documentNodes"; diff --git a/test/routes/graphql/Query/user.test.ts b/test/routes/graphql/Query/user.test.ts index 5f26af9d74..1aade1a495 100644 --- a/test/routes/graphql/Query/user.test.ts +++ b/test/routes/graphql/Query/user.test.ts @@ -4,7 +4,7 @@ import type { ArgumentsAssociatedResourcesNotFoundExtensions, InvalidArgumentsExtensions, TalawaGraphQLFormattedError, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/User/creator.test.ts b/test/routes/graphql/User/creator.test.ts index 2ce18ebd25..0f932080dc 100644 --- a/test/routes/graphql/User/creator.test.ts +++ b/test/routes/graphql/User/creator.test.ts @@ -4,7 +4,7 @@ import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, UnauthorizedActionExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/User/updatedAt.test.ts b/test/routes/graphql/User/updatedAt.test.ts index 990e139ba4..c070fccaa1 100644 --- a/test/routes/graphql/User/updatedAt.test.ts +++ b/test/routes/graphql/User/updatedAt.test.ts @@ -4,7 +4,7 @@ import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, UnauthorizedActionExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; diff --git a/test/routes/graphql/User/updater.test.ts b/test/routes/graphql/User/updater.test.ts index d4c3fcde6f..d697a7e5cb 100644 --- a/test/routes/graphql/User/updater.test.ts +++ b/test/routes/graphql/User/updater.test.ts @@ -4,7 +4,7 @@ import type { TalawaGraphQLFormattedError, UnauthenticatedExtensions, UnauthorizedActionExtensions, -} from "~/src/utilities/talawaGraphQLError"; +} from "~/src/utilities/TalawaGraphQLError"; import { assertToBeNonNullish } from "../../../helpers"; import { server } from "../../../server"; import { mercuriusClient } from "../client"; From e604d10ee8fcdd761809f76bb47d7514fef5c843 Mon Sep 17 00:00:00 2001 From: xoldd <xoldyckk@gmail.com> Date: Thu, 2 Jan 2025 00:10:55 +0530 Subject: [PATCH 4/5] add graphql schema documentation --- schema.graphql | 152 +++++++++--------- src/drizzle/enums/chatMembershipRole.ts | 2 +- .../enums/organizationMembershipRole.ts | 2 +- src/graphql/enums/AdvertisementType.ts | 2 +- src/graphql/enums/AgendaItemType.ts | 2 +- src/graphql/enums/ChatMembershipRole.ts | 3 +- src/graphql/enums/CommentVoteType.ts | 2 +- src/graphql/enums/Iso3166Alpha2CountryCode.ts | 3 +- src/graphql/enums/Iso4217CurrencyCode.ts | 3 +- .../enums/OrganizationMembershipRole.ts | 3 +- src/graphql/enums/PostVoteType.ts | 2 +- src/graphql/enums/UserEducationGrade.ts | 3 +- src/graphql/enums/UserEmploymentStatus.ts | 3 +- src/graphql/enums/UserMaritalStatus.ts | 3 +- src/graphql/enums/UserNatalSex.ts | 2 +- src/graphql/enums/UserRole.ts | 2 +- .../types/Advertisement/Advertisement.ts | 5 +- src/graphql/types/Advertisement/createdAt.ts | 2 +- src/graphql/types/Advertisement/creator.ts | 4 +- .../types/Advertisement/organization.ts | 2 +- src/graphql/types/Advertisement/updater.ts | 2 +- .../AdvertisementAttachment.ts | 2 +- .../types/AgendaFolder/AgendaFolder.ts | 3 +- src/graphql/types/AgendaFolder/createdAt.ts | 4 +- src/graphql/types/AgendaFolder/creator.ts | 6 +- src/graphql/types/AgendaFolder/event.ts | 5 +- src/graphql/types/AgendaFolder/items.ts | 2 +- .../types/AgendaFolder/parentFolder.ts | 4 +- src/graphql/types/AgendaFolder/updatedAt.ts | 2 +- src/graphql/types/AgendaFolder/updater.ts | 4 +- src/graphql/types/AgendaItem/AgendaItem.ts | 3 +- src/graphql/types/AgendaItem/createdAt.ts | 2 +- src/graphql/types/AgendaItem/creator.ts | 4 +- src/graphql/types/AgendaItem/folder.ts | 2 +- src/graphql/types/AgendaItem/updatedAt.ts | 2 +- src/graphql/types/AgendaItem/updater.ts | 4 +- src/graphql/types/Chat/Chat.ts | 3 +- src/graphql/types/Chat/createdAt.ts | 2 +- src/graphql/types/Chat/creator.ts | 4 +- src/graphql/types/Chat/messages.ts | 2 +- src/graphql/types/Chat/organization.ts | 4 +- src/graphql/types/Chat/updater.ts | 2 +- src/graphql/types/ChatMessage/ChatMessage.ts | 3 +- src/graphql/types/ChatMessage/chat.ts | 2 +- src/graphql/types/ChatMessage/creator.ts | 2 +- .../types/ChatMessage/parentChatMessage.ts | 2 +- src/graphql/types/Comment/Comment.ts | 2 +- src/graphql/types/Comment/creator.ts | 2 +- src/graphql/types/Comment/downVoters.ts | 2 +- src/graphql/types/Comment/post.ts | 4 +- src/graphql/types/Comment/upVoters.ts | 2 +- src/graphql/types/Comment/updater.ts | 4 +- src/graphql/types/Event/Event.ts | 3 +- src/graphql/types/Event/agendaFolders.ts | 2 +- src/graphql/types/Event/createdAt.ts | 2 +- src/graphql/types/Event/creator.ts | 4 +- src/graphql/types/Event/organization.ts | 4 +- src/graphql/types/Event/updater.ts | 2 +- src/graphql/types/Event/venues.ts | 2 +- .../types/EventAttachment/EventAttachment.ts | 2 +- src/graphql/types/Fund/Fund.ts | 3 +- src/graphql/types/Fund/campaigns.ts | 2 +- src/graphql/types/Fund/createdAt.ts | 2 +- src/graphql/types/Fund/creator.ts | 4 +- src/graphql/types/Fund/organization.ts | 2 +- src/graphql/types/Fund/updater.ts | 2 +- .../types/FundCampaign/FundCampaign.ts | 3 +- src/graphql/types/FundCampaign/createdAt.ts | 4 +- src/graphql/types/FundCampaign/creator.ts | 6 +- src/graphql/types/FundCampaign/fund.ts | 4 +- src/graphql/types/FundCampaign/pledges.ts | 2 +- src/graphql/types/FundCampaign/updatedAt.ts | 2 +- src/graphql/types/FundCampaign/updater.ts | 4 +- .../FundCampaignPledge/FundCampaignPledge.ts | 3 +- .../types/FundCampaignPledge/campaign.ts | 2 +- .../types/FundCampaignPledge/createdAt.ts | 2 +- .../types/FundCampaignPledge/creator.ts | 4 +- .../types/FundCampaignPledge/pledger.ts | 4 +- .../types/FundCampaignPledge/updatedAt.ts | 2 +- .../types/FundCampaignPledge/updater.ts | 4 +- .../types/Organization/Organization.ts | 6 +- .../types/Organization/advertisements.ts | 2 +- src/graphql/types/Organization/chats.ts | 2 +- src/graphql/types/Organization/creator.ts | 2 +- src/graphql/types/Organization/events.ts | 2 +- src/graphql/types/Organization/funds.ts | 2 +- src/graphql/types/Organization/pinnedPosts.ts | 2 +- .../types/Organization/pinnedPostsCount.ts | 3 +- src/graphql/types/Organization/posts.ts | 2 +- src/graphql/types/Organization/postsCount.ts | 2 +- src/graphql/types/Organization/tagFolders.ts | 2 +- src/graphql/types/Organization/tags.ts | 2 +- src/graphql/types/Organization/venues.ts | 2 +- src/graphql/types/Post/Post.ts | 3 +- src/graphql/types/Post/comments.ts | 2 +- src/graphql/types/Post/commentsCount.ts | 2 +- src/graphql/types/Post/creator.ts | 4 +- src/graphql/types/Post/downVoters.ts | 2 +- src/graphql/types/Post/organization.ts | 2 +- src/graphql/types/Post/upVoters.ts | 2 +- src/graphql/types/Post/updater.ts | 2 +- .../types/PostAttachment/PostAttachment.ts | 2 +- src/graphql/types/Tag/Tag.ts | 2 +- src/graphql/types/Tag/createdAt.ts | 2 +- src/graphql/types/Tag/creator.ts | 4 +- src/graphql/types/Tag/folder.ts | 4 +- src/graphql/types/Tag/organization.ts | 4 +- src/graphql/types/Tag/updater.ts | 2 +- src/graphql/types/TagFolder/TagFolder.ts | 3 +- src/graphql/types/TagFolder/childFolders.ts | 2 +- src/graphql/types/TagFolder/creator.ts | 4 +- src/graphql/types/TagFolder/organization.ts | 4 +- src/graphql/types/TagFolder/parentFolder.ts | 4 +- src/graphql/types/TagFolder/tags.ts | 2 +- src/graphql/types/TagFolder/updater.ts | 2 +- src/graphql/types/User/User.ts | 2 +- src/graphql/types/User/creator.ts | 4 +- src/graphql/types/User/updater.ts | 2 +- src/graphql/types/Venue/Venue.ts | 3 +- src/graphql/types/Venue/createdAt.ts | 2 +- src/graphql/types/Venue/creator.ts | 4 +- src/graphql/types/Venue/events.ts | 2 +- src/graphql/types/Venue/organization.ts | 4 +- src/graphql/types/Venue/updater.ts | 2 +- .../types/VenueAttachment/VenueAttachment.ts | 2 +- 125 files changed, 261 insertions(+), 234 deletions(-) diff --git a/schema.graphql b/schema.graphql index 721ed4e806..907dab11ea 100644 --- a/schema.graphql +++ b/schema.graphql @@ -2,10 +2,10 @@ type Advertisement { """Array of attachments.""" attachments: [AdvertisementAttachment!] - """Date time at the time the advertisement was created.""" + """Date time at the time the advertisement was first created.""" createdAt: DateTime - """User who created the advertisement.""" + """User who first created the advertisement.""" creator: User """Custom information about the advertisement.""" @@ -26,7 +26,7 @@ type Advertisement { """Date time at the time the advertised event starts at.""" startAt: DateTime - """Mime type of the attachment.""" + """Type of the advertisement.""" type: AdvertisementType """Date time at the time the advertisement was last updated.""" @@ -44,7 +44,7 @@ type AdvertisementAttachment { url: String } -"""""" +"""Possible variants of the type of an advertisement.""" enum AdvertisementType { banner menu @@ -57,13 +57,15 @@ type AgendaFolder { """ childFolders(after: String, before: String, first: Int, last: Int): AgendaFolderChildFoldersConnection - """Date time at the time the agenda folder was last created.""" + """Date time at the time the agenda folder was first created.""" createdAt: DateTime - """User who created the agenda folder.""" + """User who first created the agenda folder.""" creator: User - """Event associated to the agenda folder.""" + """ + Event for which the agenda folder contains agenda items constituting a part of the agenda. + """ event: Event """Global identifier of the agenda folder.""" @@ -75,7 +77,7 @@ type AgendaFolder { isAgendaItemFolder: Boolean """ - GraphQL connection to traverse through the agenda item associated to the agenda folder. + GraphQL connection to traverse through the agenda items contained within the agenda folder. """ items(after: String, before: String, first: Int, last: Int): AgendaFolderItemsConnection @@ -153,7 +155,7 @@ type AgendaItem { updater: User } -"""""" +"""Possible variants of the type of an agenda item.""" enum AgendaItemType { general note @@ -184,10 +186,10 @@ type Chat { """URL to the avatar of the chat.""" avatarURL: String - """Date time at the time the chat was created.""" + """Date time at the time the chat was first created.""" createdAt: DateTime - """User who created the chat.""" + """User who first created the chat.""" creator: User """Custom information about the chat.""" @@ -202,14 +204,14 @@ type Chat { members(after: String, before: String, first: Int, last: Int): ChatMembersConnection """ - GraphQL connection to traverse through the chat messages that are associated to the chat. + GraphQL connection to traverse through the messages created within the chat. """ messages(after: String, before: String, first: Int, last: Int): ChatMessagesConnection """Name of the chat.""" name: String - """Organization which the chat is associated to.""" + """Organization which the chat belongs to.""" organization: Organization """Date time at the time the chat was last updated.""" @@ -231,7 +233,7 @@ type ChatMembersConnectionEdge { node: User } -"""""" +"""Possible variants of the role assigned to a user within a chat.""" enum ChatMembershipRole { administrator regular @@ -283,7 +285,7 @@ type Comment { creator: User """ - GraphQL connection to traverse through the voters that down voted the comment. + GraphQL connection to traverse through the users that down voted the comment. """ downVoters(after: String, before: String, first: Int, last: Int): CommentDownVotersConnection @@ -293,11 +295,11 @@ type Comment { """Global identifier of the comment.""" id: ID! - """Post which the post belongs to.""" + """Post which the comment belongs to.""" post: Post """ - GraphQL connection to traverse through the voters that up voted the comment. + GraphQL connection to traverse through the users that up voted the comment. """ upVoters(after: String, before: String, first: Int, last: Int): CommentUpVotersConnection @@ -335,7 +337,7 @@ type CommentUpVotersConnectionEdge { node: User } -"""""" +"""Possible variants of the type of of a vote on a comment.""" enum CommentVoteType { down_vote up_vote @@ -358,17 +360,17 @@ scalar EmailAddress type Event { """ - GraphQL connection to traverse through the agenda folders associated to the event. + GraphQL connection to traverse through the agenda folders that contain agenda items constituting a part of the agenda for the event. """ agendaFolders(after: String, before: String, first: Int, last: Int): EventAgendaFoldersConnection """Array of attachments.""" attachments: [EventAttachment!] - """Date time at the time the event was created.""" + """Date time at the time the event was first created.""" createdAt: DateTime - """User who created the event.""" + """User who first created the event.""" creator: User """Custom information about the event.""" @@ -383,7 +385,7 @@ type Event { """Name of the event.""" name: String - """Organization associated to the event.""" + """Organization the event belongs to.""" organization: Organization """Date time at the time the event starts at.""" @@ -396,7 +398,7 @@ type Event { updater: User """ - GraphQL connection to traverse through the venues that are associated to the event. + GraphQL connection to traverse through the venues that are booked for the event. """ venues(after: String, before: String, first: Int, last: Int): EventVenuesConnection } @@ -434,15 +436,13 @@ type EventVenuesConnectionEdge { } type Fund { - """ - GraphQL connection to traverse through the fund campaigns that are associated to the fund. - """ + """GraphQL connection to traverse through the campaigns for the fund.""" campaigns(after: String, before: String, first: Int, last: Int): FundCampaignsConnection - """Date time at the time the fund was created.""" + """Date time at the time the fund was first created.""" createdAt: DateTime - """User who created the fund.""" + """User who first created the fund.""" creator: User """Global identifier of the fund.""" @@ -465,10 +465,10 @@ type Fund { } type FundCampaign { - """Date time at the time the fund campaign was created.""" + """Date time at the time the fund campaign was first created.""" createdAt: DateTime - """User who created the fund campaign.""" + """User who first created the fund campaign.""" creator: User """Currency code of the fund campaign.""" @@ -477,7 +477,7 @@ type FundCampaign { """Date time at the time the fund campaign ends at.""" endAt: DateTime - """Fund which the campaign is associated to.""" + """Fund which the fund campaign belongs to.""" fund: Fund """Minimum amount of money that is set as the goal for the fund campaign.""" @@ -493,7 +493,7 @@ type FundCampaign { pledgedAmount: BigInt """ - GraphQL connection to traverse through the pledges associated to the fund campaign. + GraphQL connection to traverse through the pledges made under the fund campaign. """ pledges(after: String, before: String, first: Int, last: Int): FundCampaignPledgesConnection @@ -560,7 +560,9 @@ type FundCampaignsConnectionEdge { node: FundCampaign } -"""""" +""" +Possible variants of the two-letter country code defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest. +""" enum Iso3166Alpha2CountryCode { ad ae @@ -813,7 +815,9 @@ enum Iso3166Alpha2CountryCode { zw } -"""""" +""" +Possible variants of the currency code defined in ISO 4217 standard published by the International Organization for Standardization (ISO) which defines alpha codes and numeric codes for the representation of currencies and provides information about the relationships between individual currencies and their minor units. +""" enum Iso4217CurrencyCode { AED AFN @@ -2193,7 +2197,7 @@ type Organization { address: String """ - GraphQL connection to traverse through the advertisements associated to the organization. + GraphQL connection to traverse through the advertisements belonging to the organization. """ advertisements(after: String, before: String, first: Int, last: Int): OrganizationAdvertisementsConnection @@ -2204,32 +2208,32 @@ type Organization { avatarURL: String """ - GraphQL connection to traverse through the chats that are associated to the organization. + GraphQL connection to traverse through the chats belonging to the organization. """ chats(after: String, before: String, first: Int, last: Int): OrganizationChatsConnection """Name of the city where the organization exists in.""" city: String - """Country code of the country the organization is a citizen of.""" + """Country code of the country the organization exists in.""" countryCode: Iso3166Alpha2CountryCode """Date time at the time the organization was created.""" createdAt: DateTime - """User who created the organization.""" + """User who first created the organization.""" creator: User """Custom information about the organization.""" description: String """ - GraphQL connection to traverse through the events associated to the organization. + GraphQL connection to traverse through the events belonging to the organization. """ events(after: String, before: String, first: Int, last: Int): OrganizationEventsConnection """ - GraphQL connection to traverse through the funds that are associated to the organization. + GraphQL connection to traverse through the funds belonging to the organization. """ funds(after: String, before: String, first: Int, last: Int): OrganizationFundsConnection @@ -2245,34 +2249,34 @@ type Organization { name: String """ - GraphQL connection to traverse through the pinned posts associated to the organization. + GraphQL connection to traverse through the pinned posts belonging to the organization. """ pinnedPosts(after: String, before: String, first: Int, last: Int): OrganizationPinnedPostsConnection - """Total number of pinned posts in the organization.""" + """Total number of pinned posts belonging to the organization.""" pinnedPostsCount: Int """Postal code of the organization.""" postalCode: String """ - GraphQL connection to traverse through the posts associated to the organization. + GraphQL connection to traverse through the posts belonging to the organization. """ posts(after: String, before: String, first: Int, last: Int): OrganizationPostsConnection - """Total number of posts in the organization.""" + """Total number of posts belonging to the organization.""" postsCount: Int """Name of the state the organization exists in.""" state: String """ - GraphQL connection to traverse through the tag folders associated to the organization. + GraphQL connection to traverse through the tag folders belonging to the organization. """ tagFolders(after: String, before: String, first: Int, last: Int): OrganizationTagFoldersConnection """ - GraphQL connection to traverse through the tags associated to the organization. + GraphQL connection to traverse through the tags belonging to the organization. """ tags(after: String, before: String, first: Int, last: Int): OrganizationTagsConnection @@ -2283,7 +2287,7 @@ type Organization { updater: User """ - GraphQL connection to traverse through the venues associated to the organization. + GraphQL connection to traverse through the venues belonging to the organization. """ venues(after: String, before: String, first: Int, last: Int): OrganizationVenuesConnection } @@ -2348,7 +2352,9 @@ type OrganizationMembersConnectionEdge { node: User } -"""""" +""" +Possible variants of the role assigned to a user within an organization. +""" enum OrganizationMembershipRole { administrator regular @@ -2434,21 +2440,21 @@ type Post { caption: String """ - GraphQL connection to traverse through the comments associated to the post. + GraphQL connection to traverse through the comments created under the post. """ comments(after: String, before: String, first: Int, last: Int): PostCommentsConnection - """Total number of comments on the post.""" + """Total number of comments created under the post.""" commentsCount: Int """Date time at the time the post was created.""" createdAt: DateTime - """User who created the post.""" + """User who first created the post.""" creator: User """ - GraphQL connection to traverse through the voters that down voted the post. + GraphQL connection to traverse through the users that down voted the post. """ downVoters(after: String, before: String, first: Int, last: Int): PostDownVotersConnection @@ -2465,7 +2471,7 @@ type Post { pinnedAt: DateTime """ - GraphQL connection to traverse through the voters that up voted the post. + GraphQL connection to traverse through the user that up voted the post. """ upVoters(after: String, before: String, first: Int, last: Int): PostUpVotersConnection @@ -2523,7 +2529,7 @@ type PostUpVotersConnectionEdge { node: User } -"""""" +"""Possible variants of the type of a vote on a post.""" enum PostVoteType { down_vote up_vote @@ -2715,13 +2721,13 @@ input SubscriptionChatMessageCreateInput { } type Tag { - """Date time at the time the tag was created.""" + """Date time at the time the tag was first created.""" createdAt: DateTime - """User who created the tag.""" + """User who first created the tag.""" creator: User - """Tag folder the tag is associated to.""" + """Tag folder the tag is contained within.""" folder: TagFolder """Global identifier of the tag.""" @@ -2730,7 +2736,7 @@ type Tag { """Name of the tag.""" name: String - """Organization the tag is associated to.""" + """Organization the tag belong to.""" organization: Organization """Date time at the time the tag was last updated.""" @@ -2742,14 +2748,14 @@ type Tag { type TagFolder { """ - GraphQL connection to traverse through the tag folders that have the tag folder as their parent folder. + GraphQL connection to traverse through the tag folders contained within the tag folder. """ childFolders(after: String, before: String, first: Int, last: Int): TagFolderChildFoldersConnection """Date time at the time the tag folder was created.""" createdAt: DateTime - """User who created the tag folder.""" + """User who first created the tag folder.""" creator: User """Global identifier of the tag folder.""" @@ -2758,14 +2764,14 @@ type TagFolder { """Name of the tag folder.""" name: String - """Organization which the tag folder is associated to.""" + """Organization which the tag folder belongs to.""" organization: Organization - """Parent folder of the tag folder.""" + """Tag folder the tag folder is contained within.""" parentFolder: TagFolder """ - GraphQL connection to traverse through the tags associated to the tag folder. + GraphQL connection to traverse through the tags contained within the tag folder. """ tags(after: String, before: String, first: Int, last: Int): TagFolderTagsConnection @@ -2825,7 +2831,7 @@ type User { """Date time at the time the user was created.""" createdAt: DateTime - """User who created the user.""" + """User who first created the user.""" creator: User """Custom information about the user.""" @@ -2889,7 +2895,7 @@ type User { workPhoneNumber: PhoneNumber } -"""""" +"""Possible variants of the education grade(if applicable) of a user.""" enum UserEducationGrade { grade_1 grade_2 @@ -2909,14 +2915,14 @@ enum UserEducationGrade { pre_kg } -"""""" +"""Possible variants of the employment status(if applicable) of a user.""" enum UserEmploymentStatus { full_time part_time unemployed } -"""""" +"""Possible variants of the martial status(if applicable) of a user.""" enum UserMaritalStatus { divorced engaged @@ -2926,7 +2932,7 @@ enum UserMaritalStatus { widowed } -"""""" +"""Possible variants of the sex assigned to a user at birth.""" enum UserNatalSex { female intersex @@ -2945,24 +2951,24 @@ type UserOrganizationsWhereMemberConnectionEdge { node: Organization } -"""""" +"""Possible variants of the role assigned to a user.""" enum UserRole { administrator regular } type Venue { - """Date time at the time the venue was created.""" + """Date time at the time the venue was first created.""" createdAt: DateTime - """User who created the venue.""" + """User who first created the venue.""" creator: User """Custom information about the venue.""" description: String """ - GraphQL connection to traverse through the events associated to the venue. + GraphQL connection to traverse through the events the venue has been booked for. """ events(after: String, before: String, first: Int, last: Int): VenueEventsConnection @@ -2972,7 +2978,7 @@ type Venue { """Name of the venue.""" name: String - """Organization associated to the venue.""" + """Organization the venue belongs to.""" organization: Organization """Date time at the time the venue was last updated.""" diff --git a/src/drizzle/enums/chatMembershipRole.ts b/src/drizzle/enums/chatMembershipRole.ts index ffe7cdfd14..1d2465be59 100644 --- a/src/drizzle/enums/chatMembershipRole.ts +++ b/src/drizzle/enums/chatMembershipRole.ts @@ -1,6 +1,6 @@ import { z } from "zod"; /** - * Possible variants of the role assigned to a chat member. + * Possible variants of the role assigned to a user within a chat. */ export const chatMembershipRoleEnum = z.enum(["administrator", "regular"]); diff --git a/src/drizzle/enums/organizationMembershipRole.ts b/src/drizzle/enums/organizationMembershipRole.ts index f20601b1fa..418c9ae02c 100644 --- a/src/drizzle/enums/organizationMembershipRole.ts +++ b/src/drizzle/enums/organizationMembershipRole.ts @@ -1,7 +1,7 @@ import { z } from "zod"; /** - * Possible variants of the role assigned to an organization member. + * Possible variants of the role assigned to a user within an organization. */ export const organizationMembershipRoleEnum = z.enum([ "administrator", diff --git a/src/graphql/enums/AdvertisementType.ts b/src/graphql/enums/AdvertisementType.ts index 2b0b6308c6..ef6a61ade3 100755 --- a/src/graphql/enums/AdvertisementType.ts +++ b/src/graphql/enums/AdvertisementType.ts @@ -2,6 +2,6 @@ import { advertisementTypeEnum } from "~/src/drizzle/enums/advertisementType"; import { builder } from "~/src/graphql/builder"; export const AdvertisementType = builder.enumType("AdvertisementType", { - description: "", + description: "Possible variants of the type of an advertisement.", values: advertisementTypeEnum.options, }); diff --git a/src/graphql/enums/AgendaItemType.ts b/src/graphql/enums/AgendaItemType.ts index 94520828e4..896466658b 100644 --- a/src/graphql/enums/AgendaItemType.ts +++ b/src/graphql/enums/AgendaItemType.ts @@ -2,6 +2,6 @@ import { agendaItemTypeEnum } from "~/src/drizzle/enums/agendaItemType"; import { builder } from "~/src/graphql/builder"; export const AgendaItemType = builder.enumType("AgendaItemType", { - description: "", + description: "Possible variants of the type of an agenda item.", values: agendaItemTypeEnum.options, }); diff --git a/src/graphql/enums/ChatMembershipRole.ts b/src/graphql/enums/ChatMembershipRole.ts index f3e584eb6c..ea0e1e1366 100644 --- a/src/graphql/enums/ChatMembershipRole.ts +++ b/src/graphql/enums/ChatMembershipRole.ts @@ -2,6 +2,7 @@ import { chatMembershipRoleEnum } from "~/src/drizzle/enums/chatMembershipRole"; import { builder } from "~/src/graphql/builder"; export const ChatMembershipRole = builder.enumType("ChatMembershipRole", { - description: "", + description: + "Possible variants of the role assigned to a user within a chat.", values: chatMembershipRoleEnum.options, }); diff --git a/src/graphql/enums/CommentVoteType.ts b/src/graphql/enums/CommentVoteType.ts index ee5fe50a10..00e30eeb4d 100755 --- a/src/graphql/enums/CommentVoteType.ts +++ b/src/graphql/enums/CommentVoteType.ts @@ -2,6 +2,6 @@ import { commentVoteTypeEnum } from "~/src/drizzle/enums/commentVoteType"; import { builder } from "~/src/graphql/builder"; export const CommentVoteType = builder.enumType("CommentVoteType", { - description: "", + description: "Possible variants of the type of of a vote on a comment.", values: commentVoteTypeEnum.options, }); diff --git a/src/graphql/enums/Iso3166Alpha2CountryCode.ts b/src/graphql/enums/Iso3166Alpha2CountryCode.ts index 4e44913131..0180f32541 100755 --- a/src/graphql/enums/Iso3166Alpha2CountryCode.ts +++ b/src/graphql/enums/Iso3166Alpha2CountryCode.ts @@ -4,7 +4,8 @@ import { builder } from "~/src/graphql/builder"; export const Iso3166Alpha2CountryCode = builder.enumType( "Iso3166Alpha2CountryCode", { - description: "", + description: + "Possible variants of the two-letter country code defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest.", values: iso3166Alpha2CountryCodeEnum.options, }, ); diff --git a/src/graphql/enums/Iso4217CurrencyCode.ts b/src/graphql/enums/Iso4217CurrencyCode.ts index c7abbd3aa5..bda007177b 100644 --- a/src/graphql/enums/Iso4217CurrencyCode.ts +++ b/src/graphql/enums/Iso4217CurrencyCode.ts @@ -2,6 +2,7 @@ import { iso4217CurrencyCodeEnum } from "~/src/drizzle/enums/iso4217CurrencyCode import { builder } from "~/src/graphql/builder"; export const Iso4217CurrencyCode = builder.enumType("Iso4217CurrencyCode", { - description: "", + description: + "Possible variants of the currency code defined in ISO 4217 standard published by the International Organization for Standardization (ISO) which defines alpha codes and numeric codes for the representation of currencies and provides information about the relationships between individual currencies and their minor units.", values: iso4217CurrencyCodeEnum.options, }); diff --git a/src/graphql/enums/OrganizationMembershipRole.ts b/src/graphql/enums/OrganizationMembershipRole.ts index e1fd848755..302aba6a34 100755 --- a/src/graphql/enums/OrganizationMembershipRole.ts +++ b/src/graphql/enums/OrganizationMembershipRole.ts @@ -4,7 +4,8 @@ import { builder } from "~/src/graphql/builder"; export const OrganizationMembershipRole = builder.enumType( "OrganizationMembershipRole", { - description: "", + description: + "Possible variants of the role assigned to a user within an organization.", values: organizationMembershipRoleEnum.options, }, ); diff --git a/src/graphql/enums/PostVoteType.ts b/src/graphql/enums/PostVoteType.ts index 83c4f5c90c..366bd93b3e 100755 --- a/src/graphql/enums/PostVoteType.ts +++ b/src/graphql/enums/PostVoteType.ts @@ -2,6 +2,6 @@ import { postVoteTypeEnum } from "~/src/drizzle/enums/postVoteType"; import { builder } from "~/src/graphql/builder"; export const PostVoteType = builder.enumType("PostVoteType", { - description: "", + description: "Possible variants of the type of a vote on a post.", values: postVoteTypeEnum.options, }); diff --git a/src/graphql/enums/UserEducationGrade.ts b/src/graphql/enums/UserEducationGrade.ts index f2b80e7761..80a164fb9f 100755 --- a/src/graphql/enums/UserEducationGrade.ts +++ b/src/graphql/enums/UserEducationGrade.ts @@ -2,6 +2,7 @@ import { userEducationGradeEnum } from "~/src/drizzle/enums/userEducationGrade"; import { builder } from "~/src/graphql/builder"; export const UserEducationGrade = builder.enumType("UserEducationGrade", { - description: "", + description: + "Possible variants of the education grade(if applicable) of a user.", values: userEducationGradeEnum.options, }); diff --git a/src/graphql/enums/UserEmploymentStatus.ts b/src/graphql/enums/UserEmploymentStatus.ts index 7846d74fd7..c2ea412957 100755 --- a/src/graphql/enums/UserEmploymentStatus.ts +++ b/src/graphql/enums/UserEmploymentStatus.ts @@ -2,6 +2,7 @@ import { userEmploymentStatusEnum } from "~/src/drizzle/enums/userEmploymentStat import { builder } from "~/src/graphql/builder"; export const UserEmploymentStatus = builder.enumType("UserEmploymentStatus", { - description: "", + description: + "Possible variants of the employment status(if applicable) of a user.", values: userEmploymentStatusEnum.options, }); diff --git a/src/graphql/enums/UserMaritalStatus.ts b/src/graphql/enums/UserMaritalStatus.ts index e4a9dbbaad..e29cda539b 100755 --- a/src/graphql/enums/UserMaritalStatus.ts +++ b/src/graphql/enums/UserMaritalStatus.ts @@ -2,6 +2,7 @@ import { userMaritalStatusEnum } from "~/src/drizzle/enums/userMaritalStatus"; import { builder } from "~/src/graphql/builder"; export const UserMaritalStatus = builder.enumType("UserMaritalStatus", { - description: "", + description: + "Possible variants of the martial status(if applicable) of a user.", values: userMaritalStatusEnum.options, }); diff --git a/src/graphql/enums/UserNatalSex.ts b/src/graphql/enums/UserNatalSex.ts index da86d1af2f..6c91f42b53 100755 --- a/src/graphql/enums/UserNatalSex.ts +++ b/src/graphql/enums/UserNatalSex.ts @@ -2,6 +2,6 @@ import { userNatalSexEnum } from "~/src/drizzle/enums/userNatalSex"; import { builder } from "~/src/graphql/builder"; export const UserNatalSex = builder.enumType("UserNatalSex", { - description: "", + description: "Possible variants of the sex assigned to a user at birth.", values: userNatalSexEnum.options, }); diff --git a/src/graphql/enums/UserRole.ts b/src/graphql/enums/UserRole.ts index 5e89e27019..d5d48d5e3a 100755 --- a/src/graphql/enums/UserRole.ts +++ b/src/graphql/enums/UserRole.ts @@ -2,6 +2,6 @@ import { userRoleEnum } from "~/src/drizzle/enums/userRole"; import { builder } from "~/src/graphql/builder"; export const UserRole = builder.enumType("UserRole", { - description: "", + description: "Possible variants of the role assigned to a user.", values: userRoleEnum.options, }); diff --git a/src/graphql/types/Advertisement/Advertisement.ts b/src/graphql/types/Advertisement/Advertisement.ts index 13ec9d30af..cd763e5bee 100644 --- a/src/graphql/types/Advertisement/Advertisement.ts +++ b/src/graphql/types/Advertisement/Advertisement.ts @@ -13,7 +13,8 @@ export type Advertisement = typeof advertisementsTable.$inferSelect & { export const Advertisement = builder.objectRef<Advertisement>("Advertisement"); Advertisement.implement({ - description: "", + description: + "Advertisements are a way for an organization to gather funds by advertising them to its members.", fields: (t) => ({ attachments: t.expose("attachments", { description: "Array of attachments.", @@ -38,7 +39,7 @@ Advertisement.implement({ type: "DateTime", }), type: t.expose("type", { - description: "Mime type of the attachment.", + description: "Type of the advertisement.", type: AdvertisementType, }), }), diff --git a/src/graphql/types/Advertisement/createdAt.ts b/src/graphql/types/Advertisement/createdAt.ts index 1a33d5fb4a..266005fe31 100644 --- a/src/graphql/types/Advertisement/createdAt.ts +++ b/src/graphql/types/Advertisement/createdAt.ts @@ -4,7 +4,7 @@ import { Advertisement } from "./Advertisement"; Advertisement.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the advertisement was created.", + description: "Date time at the time the advertisement was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Advertisement/creator.ts b/src/graphql/types/Advertisement/creator.ts index 9d844d70f7..98c843e8a0 100644 --- a/src/graphql/types/Advertisement/creator.ts +++ b/src/graphql/types/Advertisement/creator.ts @@ -5,7 +5,7 @@ import { Advertisement } from "./Advertisement"; Advertisement.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the advertisement.", + description: "User who first created the advertisement.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -69,7 +69,7 @@ Advertisement.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an advertisement's creator id that isn't null.", diff --git a/src/graphql/types/Advertisement/organization.ts b/src/graphql/types/Advertisement/organization.ts index 47520957ba..49fbf199bf 100644 --- a/src/graphql/types/Advertisement/organization.ts +++ b/src/graphql/types/Advertisement/organization.ts @@ -13,7 +13,7 @@ Advertisement.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an advertisement's organization id that isn't null.", diff --git a/src/graphql/types/Advertisement/updater.ts b/src/graphql/types/Advertisement/updater.ts index 25e3dff44f..8dc184851c 100644 --- a/src/graphql/types/Advertisement/updater.ts +++ b/src/graphql/types/Advertisement/updater.ts @@ -69,7 +69,7 @@ Advertisement.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an advertisement's updater id that isn't null.", diff --git a/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts b/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts index c95b0e37d0..b28ff142c5 100644 --- a/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts +++ b/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts @@ -8,7 +8,7 @@ export const AdvertisementAttachment = builder.objectRef<AdvertisementAttachment>("AdvertisementAttachment"); AdvertisementAttachment.implement({ - description: "", + description: "Attachment of the advertisement.", fields: (t) => ({ mimeType: t.exposeString("mimeType", { description: "Mime type of the attachment.", diff --git a/src/graphql/types/AgendaFolder/AgendaFolder.ts b/src/graphql/types/AgendaFolder/AgendaFolder.ts index cacca73217..1356bf4d1f 100644 --- a/src/graphql/types/AgendaFolder/AgendaFolder.ts +++ b/src/graphql/types/AgendaFolder/AgendaFolder.ts @@ -6,7 +6,8 @@ export type AgendaFolder = typeof agendaFoldersTable.$inferSelect; export const AgendaFolder = builder.objectRef<AgendaFolder>("AgendaFolder"); AgendaFolder.implement({ - description: "", + description: + "Agenda folders are used to contain either collections of agenda items or collections of agenda folders but not both at the same time. Together with agenda items they constitute the agenda for an event.", fields: (t) => ({ id: t.exposeID("id", { description: "Global identifier of the agenda folder.", diff --git a/src/graphql/types/AgendaFolder/createdAt.ts b/src/graphql/types/AgendaFolder/createdAt.ts index 6562f47776..966b86e852 100644 --- a/src/graphql/types/AgendaFolder/createdAt.ts +++ b/src/graphql/types/AgendaFolder/createdAt.ts @@ -4,7 +4,7 @@ import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the agenda folder was last created.", + description: "Date time at the time the agenda folder was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -57,7 +57,7 @@ AgendaFolder.implement({ }); } - // Event id existing but the associated event not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", diff --git a/src/graphql/types/AgendaFolder/creator.ts b/src/graphql/types/AgendaFolder/creator.ts index c5d337d1ce..6384680ec6 100644 --- a/src/graphql/types/AgendaFolder/creator.ts +++ b/src/graphql/types/AgendaFolder/creator.ts @@ -5,7 +5,7 @@ import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the agenda folder.", + description: "User who first created the agenda folder.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -55,7 +55,7 @@ AgendaFolder.implement({ }); } - // Event id existing but the associated event not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", @@ -100,7 +100,7 @@ AgendaFolder.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's creator id that isn't null.", diff --git a/src/graphql/types/AgendaFolder/event.ts b/src/graphql/types/AgendaFolder/event.ts index 03b3975278..97117697f8 100644 --- a/src/graphql/types/AgendaFolder/event.ts +++ b/src/graphql/types/AgendaFolder/event.ts @@ -5,7 +5,8 @@ import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ fields: (t) => ({ event: t.field({ - description: "Event associated to the agenda folder.", + description: + "Event for which the agenda folder contains agenda items constituting a part of the agenda.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -56,7 +57,7 @@ AgendaFolder.implement({ }); } - // Event id existing but the associated event not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", diff --git a/src/graphql/types/AgendaFolder/items.ts b/src/graphql/types/AgendaFolder/items.ts index 399027bc18..8d30d8bf32 100644 --- a/src/graphql/types/AgendaFolder/items.ts +++ b/src/graphql/types/AgendaFolder/items.ts @@ -52,7 +52,7 @@ AgendaFolder.implement({ items: t.connection( { description: - "GraphQL connection to traverse through the agenda item associated to the agenda folder.", + "GraphQL connection to traverse through the agenda items contained within the agenda folder.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/AgendaFolder/parentFolder.ts b/src/graphql/types/AgendaFolder/parentFolder.ts index 99982b36f2..9b9a35c126 100644 --- a/src/graphql/types/AgendaFolder/parentFolder.ts +++ b/src/graphql/types/AgendaFolder/parentFolder.ts @@ -58,7 +58,7 @@ AgendaFolder.implement({ }); } - // Event id existing but the associated event not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", @@ -99,7 +99,7 @@ AgendaFolder.implement({ operators.eq(fields.id, parentFolderId), }); - // Parent folder id existing but the associated agenda folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Parent folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's parent folder id that isn't null.", diff --git a/src/graphql/types/AgendaFolder/updatedAt.ts b/src/graphql/types/AgendaFolder/updatedAt.ts index 51a9ae431c..4428a515bc 100644 --- a/src/graphql/types/AgendaFolder/updatedAt.ts +++ b/src/graphql/types/AgendaFolder/updatedAt.ts @@ -57,7 +57,7 @@ AgendaFolder.implement({ }); } - // Event id existing but the associated event not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", diff --git a/src/graphql/types/AgendaFolder/updater.ts b/src/graphql/types/AgendaFolder/updater.ts index 22bf428ac6..ed54622c6b 100644 --- a/src/graphql/types/AgendaFolder/updater.ts +++ b/src/graphql/types/AgendaFolder/updater.ts @@ -55,7 +55,7 @@ AgendaFolder.implement({ }); } - // Event id existing but the associated event not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", @@ -100,7 +100,7 @@ AgendaFolder.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda folder's updater id that isn't null.", diff --git a/src/graphql/types/AgendaItem/AgendaItem.ts b/src/graphql/types/AgendaItem/AgendaItem.ts index a3934733da..99246694a1 100644 --- a/src/graphql/types/AgendaItem/AgendaItem.ts +++ b/src/graphql/types/AgendaItem/AgendaItem.ts @@ -7,7 +7,8 @@ export type AgendaItem = typeof agendaItemsTable.$inferSelect; export const AgendaItem = builder.objectRef<AgendaItem>("AgendaItem"); AgendaItem.implement({ - description: "", + description: + "Agenda items contain the important information about agenda for the associated event.", fields: (t) => ({ description: t.exposeString("description", { description: "Custom information about the agenda item.", diff --git a/src/graphql/types/AgendaItem/createdAt.ts b/src/graphql/types/AgendaItem/createdAt.ts index dc4f67729c..579527a99d 100644 --- a/src/graphql/types/AgendaItem/createdAt.ts +++ b/src/graphql/types/AgendaItem/createdAt.ts @@ -64,7 +64,7 @@ AgendaItem.implement({ }); } - // Folder id existing but the associated agenda folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's folder id that isn't null.", diff --git a/src/graphql/types/AgendaItem/creator.ts b/src/graphql/types/AgendaItem/creator.ts index cb5398708a..b585faeb84 100644 --- a/src/graphql/types/AgendaItem/creator.ts +++ b/src/graphql/types/AgendaItem/creator.ts @@ -62,7 +62,7 @@ AgendaItem.implement({ }); } - // Folder id existing but the associated agenda folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's folder id that isn't null.", @@ -107,7 +107,7 @@ AgendaItem.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's creator id that isn't null.", diff --git a/src/graphql/types/AgendaItem/folder.ts b/src/graphql/types/AgendaItem/folder.ts index 7296ef1581..b49de232da 100644 --- a/src/graphql/types/AgendaItem/folder.ts +++ b/src/graphql/types/AgendaItem/folder.ts @@ -62,7 +62,7 @@ AgendaItem.implement({ }); } - // Parent folder id existing but the associated agenda folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Parent folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's folder id that isn't null.", diff --git a/src/graphql/types/AgendaItem/updatedAt.ts b/src/graphql/types/AgendaItem/updatedAt.ts index 82a8f30ea7..3ced9f1ed3 100644 --- a/src/graphql/types/AgendaItem/updatedAt.ts +++ b/src/graphql/types/AgendaItem/updatedAt.ts @@ -61,7 +61,7 @@ AgendaItem.implement({ }); } - // Folder id existing but the associated agenda folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's folder id that isn't null.", diff --git a/src/graphql/types/AgendaItem/updater.ts b/src/graphql/types/AgendaItem/updater.ts index c9348393dc..8e1f620102 100644 --- a/src/graphql/types/AgendaItem/updater.ts +++ b/src/graphql/types/AgendaItem/updater.ts @@ -62,7 +62,7 @@ AgendaItem.implement({ }); } - // Folder id existing but the associated agenda folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's folder id that isn't null.", @@ -107,7 +107,7 @@ AgendaItem.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an agenda item's updater id that isn't null.", diff --git a/src/graphql/types/Chat/Chat.ts b/src/graphql/types/Chat/Chat.ts index 2ac7e55f45..d8a64da6b7 100644 --- a/src/graphql/types/Chat/Chat.ts +++ b/src/graphql/types/Chat/Chat.ts @@ -6,7 +6,8 @@ export type Chat = typeof chatsTable.$inferSelect; export const Chat = builder.objectRef<Chat>("Chat"); Chat.implement({ - description: "", + description: + "Chats are controlled spaces within organizations where their members can communicate with each other in realtime.", fields: (t) => ({ avatarMimeType: t.exposeString("avatarMimeType", { description: "Mime type of the avatar of the chat.", diff --git a/src/graphql/types/Chat/createdAt.ts b/src/graphql/types/Chat/createdAt.ts index 9e228ed447..8118bbcf10 100644 --- a/src/graphql/types/Chat/createdAt.ts +++ b/src/graphql/types/Chat/createdAt.ts @@ -4,7 +4,7 @@ import { Chat } from "./Chat"; Chat.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the chat was created.", + description: "Date time at the time the chat was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Chat/creator.ts b/src/graphql/types/Chat/creator.ts index 8f814a3554..5e8f6672f5 100644 --- a/src/graphql/types/Chat/creator.ts +++ b/src/graphql/types/Chat/creator.ts @@ -5,7 +5,7 @@ import { Chat } from "./Chat"; Chat.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the chat.", + description: "User who first created the chat.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -80,7 +80,7 @@ Chat.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a chat's creator id that isn't null.", diff --git a/src/graphql/types/Chat/messages.ts b/src/graphql/types/Chat/messages.ts index 3a2e97c0d3..53ee411449 100644 --- a/src/graphql/types/Chat/messages.ts +++ b/src/graphql/types/Chat/messages.ts @@ -48,7 +48,7 @@ Chat.implement({ messages: t.connection( { description: - "GraphQL connection to traverse through the chat messages that are associated to the chat.", + "GraphQL connection to traverse through the messages created within the chat.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Chat/organization.ts b/src/graphql/types/Chat/organization.ts index bc012a37f9..fef9501591 100644 --- a/src/graphql/types/Chat/organization.ts +++ b/src/graphql/types/Chat/organization.ts @@ -5,7 +5,7 @@ import { Chat } from "./Chat"; Chat.implement({ fields: (t) => ({ organization: t.field({ - description: "Organization which the chat is associated to.", + description: "Organization which the chat belongs to.", resolve: async (parent, _args, ctx) => { const existingOrganization = await ctx.drizzleClient.query.organizationsTable.findFirst({ @@ -13,7 +13,7 @@ Chat.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a chat's organization id that isn't null.", diff --git a/src/graphql/types/Chat/updater.ts b/src/graphql/types/Chat/updater.ts index f2a428e343..ea967a2051 100644 --- a/src/graphql/types/Chat/updater.ts +++ b/src/graphql/types/Chat/updater.ts @@ -80,7 +80,7 @@ Chat.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a chat's updater id that isn't null.", diff --git a/src/graphql/types/ChatMessage/ChatMessage.ts b/src/graphql/types/ChatMessage/ChatMessage.ts index 825624bb14..aa1b4fee2d 100644 --- a/src/graphql/types/ChatMessage/ChatMessage.ts +++ b/src/graphql/types/ChatMessage/ChatMessage.ts @@ -6,7 +6,8 @@ export type ChatMessage = typeof chatMessagesTable.$inferSelect; export const ChatMessage = builder.objectRef<ChatMessage>("ChatMessage"); ChatMessage.implement({ - description: "", + description: + "Chat messages are conversations members of a chat have with each other.", fields: (t) => ({ body: t.exposeString("body", { description: "Body of the chat message.", diff --git a/src/graphql/types/ChatMessage/chat.ts b/src/graphql/types/ChatMessage/chat.ts index 0ccdd48428..4832811945 100644 --- a/src/graphql/types/ChatMessage/chat.ts +++ b/src/graphql/types/ChatMessage/chat.ts @@ -14,7 +14,7 @@ ChatMessage.implement({ }, ); - // Chat id existing but the associated chat not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Chat id existing but the associated chat not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingChat === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a chat message's chat id that isn't null.", diff --git a/src/graphql/types/ChatMessage/creator.ts b/src/graphql/types/ChatMessage/creator.ts index 89138b1fd5..74cf7bb585 100644 --- a/src/graphql/types/ChatMessage/creator.ts +++ b/src/graphql/types/ChatMessage/creator.ts @@ -19,7 +19,7 @@ ChatMessage.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a chat's creator id that isn't null.", diff --git a/src/graphql/types/ChatMessage/parentChatMessage.ts b/src/graphql/types/ChatMessage/parentChatMessage.ts index f4b74989fc..0eca38f8c2 100644 --- a/src/graphql/types/ChatMessage/parentChatMessage.ts +++ b/src/graphql/types/ChatMessage/parentChatMessage.ts @@ -18,7 +18,7 @@ ChatMessage.implement({ operators.eq(fields.id, parentChatMessageId), }); - // Parent chat message id existing but the associated chat message not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Parent chat message id existing but the associated chat message not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingChatMessage === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a chat message's parent chat message id that isn't null.", diff --git a/src/graphql/types/Comment/Comment.ts b/src/graphql/types/Comment/Comment.ts index bd96f74233..66166a1bc2 100644 --- a/src/graphql/types/Comment/Comment.ts +++ b/src/graphql/types/Comment/Comment.ts @@ -6,7 +6,7 @@ export type Comment = typeof commentsTable.$inferSelect; export const Comment = builder.objectRef<Comment>("Comment"); Comment.implement({ - description: "", + description: "Comments are written opinions or reactions by users on a post.", fields: (t) => ({ body: t.exposeString("body", { description: "Body of the comment.", diff --git a/src/graphql/types/Comment/creator.ts b/src/graphql/types/Comment/creator.ts index e0e74c6924..3c0ac6a29c 100644 --- a/src/graphql/types/Comment/creator.ts +++ b/src/graphql/types/Comment/creator.ts @@ -19,7 +19,7 @@ Comment.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a comment's creator id that isn't null.", diff --git a/src/graphql/types/Comment/downVoters.ts b/src/graphql/types/Comment/downVoters.ts index d97c2e994d..3ffc774850 100644 --- a/src/graphql/types/Comment/downVoters.ts +++ b/src/graphql/types/Comment/downVoters.ts @@ -61,7 +61,7 @@ Comment.implement({ downVoters: t.connection( { description: - "GraphQL connection to traverse through the voters that down voted the comment.", + "GraphQL connection to traverse through the users that down voted the comment.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Comment/post.ts b/src/graphql/types/Comment/post.ts index 06b6918831..4f950c4c58 100644 --- a/src/graphql/types/Comment/post.ts +++ b/src/graphql/types/Comment/post.ts @@ -5,7 +5,7 @@ import { Comment } from "./Comment"; Comment.implement({ fields: (t) => ({ post: t.field({ - description: "Post which the post belongs to.", + description: "Post which the comment belongs to.", resolve: async (parent, _args, ctx) => { const existingPost = await ctx.drizzleClient.query.postsTable.findFirst( { @@ -17,7 +17,7 @@ Comment.implement({ }, ); - // Post id existing but the associated post not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Post id existing but the associated post not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingPost === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a comment's post id that isn't null.", diff --git a/src/graphql/types/Comment/upVoters.ts b/src/graphql/types/Comment/upVoters.ts index fad9fc3875..ed190f2067 100644 --- a/src/graphql/types/Comment/upVoters.ts +++ b/src/graphql/types/Comment/upVoters.ts @@ -61,7 +61,7 @@ Comment.implement({ upVoters: t.connection( { description: - "GraphQL connection to traverse through the voters that up voted the comment.", + "GraphQL connection to traverse through the users that up voted the comment.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Comment/updater.ts b/src/graphql/types/Comment/updater.ts index c8360848e0..9afd432f1a 100644 --- a/src/graphql/types/Comment/updater.ts +++ b/src/graphql/types/Comment/updater.ts @@ -55,7 +55,7 @@ Comment.implement({ }); } - // Post id existing but the associated post not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Post id existing but the associated post not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingPost === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a comment's post id that isn't null.", @@ -98,7 +98,7 @@ Comment.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a comment's updater id that isn't null.", diff --git a/src/graphql/types/Event/Event.ts b/src/graphql/types/Event/Event.ts index fc2577cc61..e5466738b2 100644 --- a/src/graphql/types/Event/Event.ts +++ b/src/graphql/types/Event/Event.ts @@ -12,7 +12,8 @@ export type Event = typeof eventsTable.$inferSelect & { export const Event = builder.objectRef<Event>("Event"); Event.implement({ - description: "", + description: + "Events are occurrences that take place for specific purposes at specific times.", fields: (t) => ({ attachments: t.expose("attachments", { description: "Array of attachments.", diff --git a/src/graphql/types/Event/agendaFolders.ts b/src/graphql/types/Event/agendaFolders.ts index deabc8f93b..d599fee1d6 100644 --- a/src/graphql/types/Event/agendaFolders.ts +++ b/src/graphql/types/Event/agendaFolders.ts @@ -63,7 +63,7 @@ Event.implement({ agendaFolders: t.connection( { description: - "GraphQL connection to traverse through the agenda folders associated to the event.", + "GraphQL connection to traverse through the agenda folders that contain agenda items constituting a part of the agenda for the event.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Event/createdAt.ts b/src/graphql/types/Event/createdAt.ts index 18fdf800db..9d44c96975 100644 --- a/src/graphql/types/Event/createdAt.ts +++ b/src/graphql/types/Event/createdAt.ts @@ -4,7 +4,7 @@ import { Event } from "./Event"; Event.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the event was created.", + description: "Date time at the time the event was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Event/creator.ts b/src/graphql/types/Event/creator.ts index d808d989c4..0a31096e0e 100644 --- a/src/graphql/types/Event/creator.ts +++ b/src/graphql/types/Event/creator.ts @@ -5,7 +5,7 @@ import { Event } from "./Event"; Event.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the event.", + description: "User who first created the event.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -69,7 +69,7 @@ Event.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an event's creator id that isn't null.", diff --git a/src/graphql/types/Event/organization.ts b/src/graphql/types/Event/organization.ts index c5122aa690..617a76aa96 100644 --- a/src/graphql/types/Event/organization.ts +++ b/src/graphql/types/Event/organization.ts @@ -5,7 +5,7 @@ import { Event } from "./Event"; Event.implement({ fields: (t) => ({ organization: t.field({ - description: "Organization associated to the event.", + description: "Organization the event belongs to.", resolve: async (parent, _args, ctx) => { const existingOrganization = await ctx.drizzleClient.query.organizationsTable.findFirst({ @@ -13,7 +13,7 @@ Event.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a event's organization id that isn't null.", diff --git a/src/graphql/types/Event/updater.ts b/src/graphql/types/Event/updater.ts index 1d2d287757..bd0c767c0d 100644 --- a/src/graphql/types/Event/updater.ts +++ b/src/graphql/types/Event/updater.ts @@ -69,7 +69,7 @@ Event.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for an event's updater id that isn't null.", diff --git a/src/graphql/types/Event/venues.ts b/src/graphql/types/Event/venues.ts index b8d0a010be..52a10980bb 100644 --- a/src/graphql/types/Event/venues.ts +++ b/src/graphql/types/Event/venues.ts @@ -52,7 +52,7 @@ Event.implement({ venues: t.connection( { description: - "GraphQL connection to traverse through the venues that are associated to the event.", + "GraphQL connection to traverse through the venues that are booked for the event.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/EventAttachment/EventAttachment.ts b/src/graphql/types/EventAttachment/EventAttachment.ts index 6908befc2f..5eb5c20bd4 100644 --- a/src/graphql/types/EventAttachment/EventAttachment.ts +++ b/src/graphql/types/EventAttachment/EventAttachment.ts @@ -7,7 +7,7 @@ export const EventAttachment = builder.objectRef<EventAttachment>("EventAttachment"); EventAttachment.implement({ - description: "", + description: "Attachment of the event.", fields: (t) => ({ mimeType: t.exposeString("mimeType", { description: "Mime type of the attachment.", diff --git a/src/graphql/types/Fund/Fund.ts b/src/graphql/types/Fund/Fund.ts index f2dbfaa3ac..29cc1f537c 100644 --- a/src/graphql/types/Fund/Fund.ts +++ b/src/graphql/types/Fund/Fund.ts @@ -6,7 +6,8 @@ export type Fund = typeof fundsTable.$inferSelect; export const Fund = builder.objectRef<Fund>("Fund"); Fund.implement({ - description: "", + description: + "Funds are sums of money possessed by organizations for specific purposes pertaning to them.", fields: (t) => ({ id: t.exposeID("id", { description: "Global identifier of the fund.", diff --git a/src/graphql/types/Fund/campaigns.ts b/src/graphql/types/Fund/campaigns.ts index f010ea8d84..8208474813 100644 --- a/src/graphql/types/Fund/campaigns.ts +++ b/src/graphql/types/Fund/campaigns.ts @@ -48,7 +48,7 @@ Fund.implement({ campaigns: t.connection( { description: - "GraphQL connection to traverse through the fund campaigns that are associated to the fund.", + "GraphQL connection to traverse through the campaigns for the fund.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Fund/createdAt.ts b/src/graphql/types/Fund/createdAt.ts index 63f5dfad17..ce084f77e0 100644 --- a/src/graphql/types/Fund/createdAt.ts +++ b/src/graphql/types/Fund/createdAt.ts @@ -4,7 +4,7 @@ import { Fund } from "./Fund"; Fund.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the fund was created.", + description: "Date time at the time the fund was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Fund/creator.ts b/src/graphql/types/Fund/creator.ts index 4c87d4c18d..d014eacf74 100644 --- a/src/graphql/types/Fund/creator.ts +++ b/src/graphql/types/Fund/creator.ts @@ -5,7 +5,7 @@ import { Fund } from "./Fund"; Fund.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the fund.", + description: "User who first created the fund.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -69,7 +69,7 @@ Fund.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund's creator id that isn't null.", diff --git a/src/graphql/types/Fund/organization.ts b/src/graphql/types/Fund/organization.ts index 702c947d9e..11e1cd7d77 100644 --- a/src/graphql/types/Fund/organization.ts +++ b/src/graphql/types/Fund/organization.ts @@ -13,7 +13,7 @@ Fund.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund's organization id that isn't null.", diff --git a/src/graphql/types/Fund/updater.ts b/src/graphql/types/Fund/updater.ts index c536cfff5b..7bab9fa33d 100644 --- a/src/graphql/types/Fund/updater.ts +++ b/src/graphql/types/Fund/updater.ts @@ -69,7 +69,7 @@ Fund.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund's updater id that isn't null.", diff --git a/src/graphql/types/FundCampaign/FundCampaign.ts b/src/graphql/types/FundCampaign/FundCampaign.ts index 1da3c4c980..46da6fc5bd 100644 --- a/src/graphql/types/FundCampaign/FundCampaign.ts +++ b/src/graphql/types/FundCampaign/FundCampaign.ts @@ -7,7 +7,8 @@ export type FundCampaign = typeof fundCampaignsTable.$inferSelect; export const FundCampaign = builder.objectRef<FundCampaign>("FundCampaign"); FundCampaign.implement({ - description: "", + description: + "Fund campaigns are specific events created for the purpose of raising organization funds.", fields: (t) => ({ currencyCode: t.expose("currencyCode", { description: "Currency code of the fund campaign.", diff --git a/src/graphql/types/FundCampaign/createdAt.ts b/src/graphql/types/FundCampaign/createdAt.ts index 7e122c979e..9fcfd399c1 100644 --- a/src/graphql/types/FundCampaign/createdAt.ts +++ b/src/graphql/types/FundCampaign/createdAt.ts @@ -4,7 +4,7 @@ import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the fund campaign was created.", + description: "Date time at the time the fund campaign was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -58,7 +58,7 @@ FundCampaign.implement({ }); } - // Fund id existing but the associated fund not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund id existing but the associated fund not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFund === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", diff --git a/src/graphql/types/FundCampaign/creator.ts b/src/graphql/types/FundCampaign/creator.ts index 8da5269666..c0b5fb76e2 100644 --- a/src/graphql/types/FundCampaign/creator.ts +++ b/src/graphql/types/FundCampaign/creator.ts @@ -5,7 +5,7 @@ import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the fund campaign.", + description: "User who first created the fund campaign.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -55,7 +55,7 @@ FundCampaign.implement({ }); } - // Fund id existing but the associated fund not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund id existing but the associated fund not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFund === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", @@ -98,7 +98,7 @@ FundCampaign.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's creator id that isn't null.", diff --git a/src/graphql/types/FundCampaign/fund.ts b/src/graphql/types/FundCampaign/fund.ts index c82e7f248f..4a40dfc3a6 100644 --- a/src/graphql/types/FundCampaign/fund.ts +++ b/src/graphql/types/FundCampaign/fund.ts @@ -5,7 +5,7 @@ import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ fields: (t) => ({ fund: t.field({ - description: "Fund which the campaign is associated to.", + description: "Fund which the fund campaign belongs to.", resolve: async (parent, _args, ctx) => { const existingFund = await ctx.drizzleClient.query.fundsTable.findFirst( { @@ -14,7 +14,7 @@ FundCampaign.implement({ }, ); - // Fund id existing but the associated fund not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund id existing but the associated fund not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFund === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag's fund id that isn't null.", diff --git a/src/graphql/types/FundCampaign/pledges.ts b/src/graphql/types/FundCampaign/pledges.ts index e1b46f679e..f3def7683d 100644 --- a/src/graphql/types/FundCampaign/pledges.ts +++ b/src/graphql/types/FundCampaign/pledges.ts @@ -48,7 +48,7 @@ FundCampaign.implement({ pledges: t.connection( { description: - "GraphQL connection to traverse through the pledges associated to the fund campaign.", + "GraphQL connection to traverse through the pledges made under the fund campaign.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/FundCampaign/updatedAt.ts b/src/graphql/types/FundCampaign/updatedAt.ts index f72d70d684..91a929547d 100644 --- a/src/graphql/types/FundCampaign/updatedAt.ts +++ b/src/graphql/types/FundCampaign/updatedAt.ts @@ -58,7 +58,7 @@ FundCampaign.implement({ }); } - // Fund id existing but the associated fund not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund id existing but the associated fund not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFund === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", diff --git a/src/graphql/types/FundCampaign/updater.ts b/src/graphql/types/FundCampaign/updater.ts index c6fc334b91..c74cd7f3c5 100644 --- a/src/graphql/types/FundCampaign/updater.ts +++ b/src/graphql/types/FundCampaign/updater.ts @@ -55,7 +55,7 @@ FundCampaign.implement({ }); } - // Fund id existing but the associated fund not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund id existing but the associated fund not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFund === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", @@ -98,7 +98,7 @@ FundCampaign.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's updater id that isn't null.", diff --git a/src/graphql/types/FundCampaignPledge/FundCampaignPledge.ts b/src/graphql/types/FundCampaignPledge/FundCampaignPledge.ts index dc7cab4e45..37d5faa29d 100644 --- a/src/graphql/types/FundCampaignPledge/FundCampaignPledge.ts +++ b/src/graphql/types/FundCampaignPledge/FundCampaignPledge.ts @@ -7,7 +7,8 @@ export const FundCampaignPledge = builder.objectRef<FundCampaignPledge>("FundCampaignPledge"); FundCampaignPledge.implement({ - description: "", + description: + "Fund campaign pledges are records of monetary pledges that users make to funds of organizations under a fund campaign.", fields: (t) => ({ amount: t.exposeInt("amount", { description: "The amount of pledged money.", diff --git a/src/graphql/types/FundCampaignPledge/campaign.ts b/src/graphql/types/FundCampaignPledge/campaign.ts index 2ae781ae4d..4467915fbe 100644 --- a/src/graphql/types/FundCampaignPledge/campaign.ts +++ b/src/graphql/types/FundCampaignPledge/campaign.ts @@ -14,7 +14,7 @@ FundCampaignPledge.implement({ operators.eq(fields.id, parent.campaignId), }); - // Fund campaign id existing but the associated fund campaign not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund campaign id existing but the associated fund campaign not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFundCampaign === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's campaign id that isn't null.", diff --git a/src/graphql/types/FundCampaignPledge/createdAt.ts b/src/graphql/types/FundCampaignPledge/createdAt.ts index 362a6dad8e..c7202dea7d 100644 --- a/src/graphql/types/FundCampaignPledge/createdAt.ts +++ b/src/graphql/types/FundCampaignPledge/createdAt.ts @@ -66,7 +66,7 @@ FundCampaignPledge.implement({ }); } - // Fund campaign id existing but the associated fund campaign not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund campaign id existing but the associated fund campaign not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFundCampaign === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's campaign id that isn't null.", diff --git a/src/graphql/types/FundCampaignPledge/creator.ts b/src/graphql/types/FundCampaignPledge/creator.ts index eaa17bcbc4..828f2c4f55 100644 --- a/src/graphql/types/FundCampaignPledge/creator.ts +++ b/src/graphql/types/FundCampaignPledge/creator.ts @@ -62,7 +62,7 @@ FundCampaignPledge.implement({ }); } - // Fund campaign id existing but the associated fund campaign not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund campaign id existing but the associated fund campaign not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFundCampaign === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's campaign id that isn't null.", @@ -107,7 +107,7 @@ FundCampaignPledge.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's creator id that isn't null.", diff --git a/src/graphql/types/FundCampaignPledge/pledger.ts b/src/graphql/types/FundCampaignPledge/pledger.ts index 5248c70b74..c8a967b070 100644 --- a/src/graphql/types/FundCampaignPledge/pledger.ts +++ b/src/graphql/types/FundCampaignPledge/pledger.ts @@ -62,7 +62,7 @@ FundCampaignPledge.implement({ }); } - // Fund campaign id existing but the associated fund campaign not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund campaign id existing but the associated fund campaign not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFundCampaign === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's campaign id that isn't null.", @@ -103,7 +103,7 @@ FundCampaignPledge.implement({ }, ); - // Pledger id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Pledger id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's pledger id that isn't null.", diff --git a/src/graphql/types/FundCampaignPledge/updatedAt.ts b/src/graphql/types/FundCampaignPledge/updatedAt.ts index 7bff93dbea..fd3b5cc70c 100644 --- a/src/graphql/types/FundCampaignPledge/updatedAt.ts +++ b/src/graphql/types/FundCampaignPledge/updatedAt.ts @@ -65,7 +65,7 @@ FundCampaignPledge.implement({ }); } - // Fund campaign id existing but the associated fund campaign not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund campaign id existing but the associated fund campaign not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFundCampaign === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's campaign id that isn't null.", diff --git a/src/graphql/types/FundCampaignPledge/updater.ts b/src/graphql/types/FundCampaignPledge/updater.ts index 1ca4a9c30c..976fd2584e 100644 --- a/src/graphql/types/FundCampaignPledge/updater.ts +++ b/src/graphql/types/FundCampaignPledge/updater.ts @@ -62,7 +62,7 @@ FundCampaignPledge.implement({ }); } - // Fund campaign id existing but the associated fund campaign not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Fund campaign id existing but the associated fund campaign not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFundCampaign === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's campaign id that isn't null.", @@ -107,7 +107,7 @@ FundCampaignPledge.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a fund campaign pledge's updater id that isn't null.", diff --git a/src/graphql/types/Organization/Organization.ts b/src/graphql/types/Organization/Organization.ts index 524bad9ce4..d73dc1d1b1 100644 --- a/src/graphql/types/Organization/Organization.ts +++ b/src/graphql/types/Organization/Organization.ts @@ -7,7 +7,8 @@ export type Organization = typeof organizationsTable.$inferSelect; export const Organization = builder.objectRef<Organization>("Organization"); Organization.implement({ - description: "", + description: + "Organizations are controlled spaces of collections of users who associate with the purpose those organizations exist for.", fields: (t) => ({ address: t.exposeString("address", { description: "Address of the organization.", @@ -19,8 +20,7 @@ Organization.implement({ description: "Name of the city where the organization exists in.", }), countryCode: t.expose("countryCode", { - description: - "Country code of the country the organization is a citizen of.", + description: "Country code of the country the organization exists in.", type: Iso3166Alpha2CountryCode, }), createdAt: t.expose("createdAt", { diff --git a/src/graphql/types/Organization/advertisements.ts b/src/graphql/types/Organization/advertisements.ts index 83a41c8b04..12c7ab9b1a 100644 --- a/src/graphql/types/Organization/advertisements.ts +++ b/src/graphql/types/Organization/advertisements.ts @@ -48,7 +48,7 @@ Organization.implement({ advertisements: t.connection( { description: - "GraphQL connection to traverse through the advertisements associated to the organization.", + "GraphQL connection to traverse through the advertisements belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/chats.ts b/src/graphql/types/Organization/chats.ts index 9910f9fd5a..29993121ae 100644 --- a/src/graphql/types/Organization/chats.ts +++ b/src/graphql/types/Organization/chats.ts @@ -49,7 +49,7 @@ Organization.implement({ chats: t.connection( { description: - "GraphQL connection to traverse through the chats that are associated to the organization.", + "GraphQL connection to traverse through the chats belonging to the organization.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Organization/creator.ts b/src/graphql/types/Organization/creator.ts index 86addf74e6..852a2600f8 100755 --- a/src/graphql/types/Organization/creator.ts +++ b/src/graphql/types/Organization/creator.ts @@ -5,7 +5,7 @@ import { Organization } from "./Organization"; Organization.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the organization.", + description: "User who first created the organization.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/events.ts b/src/graphql/types/Organization/events.ts index c627761fa6..37b9ec0e2e 100644 --- a/src/graphql/types/Organization/events.ts +++ b/src/graphql/types/Organization/events.ts @@ -52,7 +52,7 @@ Organization.implement({ events: t.connection( { description: - "GraphQL connection to traverse through the events associated to the organization.", + "GraphQL connection to traverse through the events belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/funds.ts b/src/graphql/types/Organization/funds.ts index 7d6fd90f1f..ae65ff5178 100644 --- a/src/graphql/types/Organization/funds.ts +++ b/src/graphql/types/Organization/funds.ts @@ -45,7 +45,7 @@ Organization.implement({ funds: t.connection( { description: - "GraphQL connection to traverse through the funds that are associated to the organization.", + "GraphQL connection to traverse through the funds belonging to the organization.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Organization/pinnedPosts.ts b/src/graphql/types/Organization/pinnedPosts.ts index 401074747b..6d9e8f6042 100644 --- a/src/graphql/types/Organization/pinnedPosts.ts +++ b/src/graphql/types/Organization/pinnedPosts.ts @@ -58,7 +58,7 @@ Organization.implement({ pinnedPosts: t.connection( { description: - "GraphQL connection to traverse through the pinned posts associated to the organization.", + "GraphQL connection to traverse through the pinned posts belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/pinnedPostsCount.ts b/src/graphql/types/Organization/pinnedPostsCount.ts index eec046be95..aa0d6a16b2 100644 --- a/src/graphql/types/Organization/pinnedPostsCount.ts +++ b/src/graphql/types/Organization/pinnedPostsCount.ts @@ -5,7 +5,8 @@ import { Organization } from "./Organization"; Organization.implement({ fields: (t) => ({ pinnedPostsCount: t.field({ - description: "Total number of pinned posts in the organization.", + description: + "Total number of pinned posts belonging to the organization.", resolve: async (parent, _args, ctx) => { const [postsCount] = await ctx.drizzleClient .select({ diff --git a/src/graphql/types/Organization/posts.ts b/src/graphql/types/Organization/posts.ts index 5819c07c54..294d070065 100644 --- a/src/graphql/types/Organization/posts.ts +++ b/src/graphql/types/Organization/posts.ts @@ -45,7 +45,7 @@ Organization.implement({ posts: t.connection( { description: - "GraphQL connection to traverse through the posts associated to the organization.", + "GraphQL connection to traverse through the posts belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/postsCount.ts b/src/graphql/types/Organization/postsCount.ts index a769e9837d..2a6f35ec2b 100644 --- a/src/graphql/types/Organization/postsCount.ts +++ b/src/graphql/types/Organization/postsCount.ts @@ -5,7 +5,7 @@ import { Organization } from "./Organization"; Organization.implement({ fields: (t) => ({ postsCount: t.field({ - description: "Total number of posts in the organization.", + description: "Total number of posts belonging to the organization.", resolve: async (parent, _args, ctx) => { const [postsCount] = await ctx.drizzleClient .select({ diff --git a/src/graphql/types/Organization/tagFolders.ts b/src/graphql/types/Organization/tagFolders.ts index 08a0004c7c..9913cf5f17 100644 --- a/src/graphql/types/Organization/tagFolders.ts +++ b/src/graphql/types/Organization/tagFolders.ts @@ -63,7 +63,7 @@ Organization.implement({ tagFolders: t.connection( { description: - "GraphQL connection to traverse through the tag folders associated to the organization.", + "GraphQL connection to traverse through the tag folders belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/tags.ts b/src/graphql/types/Organization/tags.ts index c475038aa4..1d6c774b57 100644 --- a/src/graphql/types/Organization/tags.ts +++ b/src/graphql/types/Organization/tags.ts @@ -45,7 +45,7 @@ Organization.implement({ tags: t.connection( { description: - "GraphQL connection to traverse through the tags associated to the organization.", + "GraphQL connection to traverse through the tags belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Organization/venues.ts b/src/graphql/types/Organization/venues.ts index a1409a29ec..56e7aa6ef2 100644 --- a/src/graphql/types/Organization/venues.ts +++ b/src/graphql/types/Organization/venues.ts @@ -48,7 +48,7 @@ Organization.implement({ venues: t.connection( { description: - "GraphQL connection to traverse through the venues associated to the organization.", + "GraphQL connection to traverse through the venues belonging to the organization.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Post/Post.ts b/src/graphql/types/Post/Post.ts index f6f4f944be..44b72ba99f 100644 --- a/src/graphql/types/Post/Post.ts +++ b/src/graphql/types/Post/Post.ts @@ -12,7 +12,8 @@ export type Post = typeof postsTable.$inferSelect & { export const Post = builder.objectRef<Post>("Post"); Post.implement({ - description: "", + description: + "Posts are a feature for members of organizations to share text and media within the organization.", fields: (t) => ({ attachments: t.expose("attachments", { description: "Array of attachments.", diff --git a/src/graphql/types/Post/comments.ts b/src/graphql/types/Post/comments.ts index e7fcd7ed4f..96dfb6ab6b 100644 --- a/src/graphql/types/Post/comments.ts +++ b/src/graphql/types/Post/comments.ts @@ -48,7 +48,7 @@ Post.implement({ comments: t.connection( { description: - "GraphQL connection to traverse through the comments associated to the post.", + "GraphQL connection to traverse through the comments created under the post.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Post/commentsCount.ts b/src/graphql/types/Post/commentsCount.ts index 58f56dc772..26e4c2c302 100644 --- a/src/graphql/types/Post/commentsCount.ts +++ b/src/graphql/types/Post/commentsCount.ts @@ -5,7 +5,7 @@ import { Post } from "./Post"; Post.implement({ fields: (t) => ({ commentsCount: t.field({ - description: "Total number of comments on the post.", + description: "Total number of comments created under the post.", resolve: async (parent, _args, ctx) => { const [commentsCount] = await ctx.drizzleClient .select({ diff --git a/src/graphql/types/Post/creator.ts b/src/graphql/types/Post/creator.ts index 6a51489006..cf58741d8e 100644 --- a/src/graphql/types/Post/creator.ts +++ b/src/graphql/types/Post/creator.ts @@ -5,7 +5,7 @@ import { Post } from "./Post"; Post.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the post.", + description: "User who first created the post.", resolve: async (parent, _args, ctx) => { if (parent.creatorId === null) { return null; @@ -19,7 +19,7 @@ Post.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a post's creator id that isn't null.", diff --git a/src/graphql/types/Post/downVoters.ts b/src/graphql/types/Post/downVoters.ts index 0a548c92c3..328f2c9c2c 100644 --- a/src/graphql/types/Post/downVoters.ts +++ b/src/graphql/types/Post/downVoters.ts @@ -61,7 +61,7 @@ Post.implement({ downVoters: t.connection( { description: - "GraphQL connection to traverse through the voters that down voted the post.", + "GraphQL connection to traverse through the users that down voted the post.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Post/organization.ts b/src/graphql/types/Post/organization.ts index 63d9d80ac7..3c2b49ea3d 100644 --- a/src/graphql/types/Post/organization.ts +++ b/src/graphql/types/Post/organization.ts @@ -13,7 +13,7 @@ Post.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a post's organization id that isn't null.", diff --git a/src/graphql/types/Post/upVoters.ts b/src/graphql/types/Post/upVoters.ts index 054484275b..a922dc37cf 100644 --- a/src/graphql/types/Post/upVoters.ts +++ b/src/graphql/types/Post/upVoters.ts @@ -61,7 +61,7 @@ Post.implement({ upVoters: t.connection( { description: - "GraphQL connection to traverse through the voters that up voted the post.", + "GraphQL connection to traverse through the user that up voted the post.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/Post/updater.ts b/src/graphql/types/Post/updater.ts index 9f154596db..1d7c1e23af 100644 --- a/src/graphql/types/Post/updater.ts +++ b/src/graphql/types/Post/updater.ts @@ -69,7 +69,7 @@ Post.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a post's updater id that isn't null.", diff --git a/src/graphql/types/PostAttachment/PostAttachment.ts b/src/graphql/types/PostAttachment/PostAttachment.ts index 0d16c82b1b..a27e181cc3 100644 --- a/src/graphql/types/PostAttachment/PostAttachment.ts +++ b/src/graphql/types/PostAttachment/PostAttachment.ts @@ -7,7 +7,7 @@ export const PostAttachment = builder.objectRef<PostAttachment>("PostAttachment"); PostAttachment.implement({ - description: "", + description: "Attachment of the post.", fields: (t) => ({ mimeType: t.exposeString("mimeType", { description: "Mime type of the attachment.", diff --git a/src/graphql/types/Tag/Tag.ts b/src/graphql/types/Tag/Tag.ts index dd2dfd8f9c..8e283d404d 100644 --- a/src/graphql/types/Tag/Tag.ts +++ b/src/graphql/types/Tag/Tag.ts @@ -6,7 +6,7 @@ export type Tag = typeof tagsTable.$inferSelect; export const Tag = builder.objectRef<Tag>("Tag"); Tag.implement({ - description: "", + description: "Tags are a feature to manage organization members.", fields: (t) => ({ id: t.exposeID("id", { description: "Global identifier of the tag.", diff --git a/src/graphql/types/Tag/createdAt.ts b/src/graphql/types/Tag/createdAt.ts index 695742b95f..76f8f3706d 100644 --- a/src/graphql/types/Tag/createdAt.ts +++ b/src/graphql/types/Tag/createdAt.ts @@ -4,7 +4,7 @@ import { Tag } from "./Tag"; Tag.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the tag was created.", + description: "Date time at the time the tag was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Tag/creator.ts b/src/graphql/types/Tag/creator.ts index 493fda1949..bd42052614 100644 --- a/src/graphql/types/Tag/creator.ts +++ b/src/graphql/types/Tag/creator.ts @@ -5,7 +5,7 @@ import { Tag } from "./Tag"; Tag.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the tag.", + description: "User who first created the tag.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -69,7 +69,7 @@ Tag.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag's creator id that isn't null.", diff --git a/src/graphql/types/Tag/folder.ts b/src/graphql/types/Tag/folder.ts index b51ce70c20..82e47880d6 100644 --- a/src/graphql/types/Tag/folder.ts +++ b/src/graphql/types/Tag/folder.ts @@ -5,7 +5,7 @@ import { Tag } from "./Tag"; Tag.implement({ fields: (t) => ({ folder: t.field({ - description: "Tag folder the tag is associated to.", + description: "Tag folder the tag is contained within.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -64,7 +64,7 @@ Tag.implement({ where: (fields, operators) => operators.eq(fields.id, folderId), }); - // Folder id existing but the associated tag folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Folder id existing but the associated tag folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag's folder id that isn't null.", diff --git a/src/graphql/types/Tag/organization.ts b/src/graphql/types/Tag/organization.ts index 9afcc6cdb0..1143963367 100644 --- a/src/graphql/types/Tag/organization.ts +++ b/src/graphql/types/Tag/organization.ts @@ -5,7 +5,7 @@ import { Tag } from "./Tag"; Tag.implement({ fields: (t) => ({ organization: t.field({ - description: "Organization the tag is associated to.", + description: "Organization the tag belong to.", resolve: async (parent, _args, ctx) => { const existingOrganization = await ctx.drizzleClient.query.organizationsTable.findFirst({ @@ -13,7 +13,7 @@ Tag.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag's organization id that isn't null.", diff --git a/src/graphql/types/Tag/updater.ts b/src/graphql/types/Tag/updater.ts index 0ca5674e19..de3e2b4cdd 100644 --- a/src/graphql/types/Tag/updater.ts +++ b/src/graphql/types/Tag/updater.ts @@ -69,7 +69,7 @@ Tag.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag's updater id that isn't null.", diff --git a/src/graphql/types/TagFolder/TagFolder.ts b/src/graphql/types/TagFolder/TagFolder.ts index 5b05c33d72..62247147a8 100644 --- a/src/graphql/types/TagFolder/TagFolder.ts +++ b/src/graphql/types/TagFolder/TagFolder.ts @@ -6,7 +6,8 @@ export type TagFolder = typeof tagFoldersTable.$inferSelect; export const TagFolder = builder.objectRef<TagFolder>("TagFolder"); TagFolder.implement({ - description: "", + description: + "Tag folders are a feature to conveniently manage tags belonging to organizations.", fields: (t) => ({ createdAt: t.expose("createdAt", { description: "Date time at the time the tag folder was created.", diff --git a/src/graphql/types/TagFolder/childFolders.ts b/src/graphql/types/TagFolder/childFolders.ts index a7eb9174f5..d5837ec486 100644 --- a/src/graphql/types/TagFolder/childFolders.ts +++ b/src/graphql/types/TagFolder/childFolders.ts @@ -47,7 +47,7 @@ TagFolder.implement({ childFolders: t.connection( { description: - "GraphQL connection to traverse through the tag folders that have the tag folder as their parent folder.", + "GraphQL connection to traverse through the tag folders contained within the tag folder.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/TagFolder/creator.ts b/src/graphql/types/TagFolder/creator.ts index c631624cfa..65de6cd0d6 100644 --- a/src/graphql/types/TagFolder/creator.ts +++ b/src/graphql/types/TagFolder/creator.ts @@ -5,7 +5,7 @@ import { TagFolder } from "./TagFolder"; TagFolder.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the tag folder.", + description: "User who first created the tag folder.", resolve: async (parent, _args, ctx) => { if (parent.creatorId === null) { return null; @@ -19,7 +19,7 @@ TagFolder.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag folder's creator id that isn't null.", diff --git a/src/graphql/types/TagFolder/organization.ts b/src/graphql/types/TagFolder/organization.ts index c159b61d6c..85f30a5059 100644 --- a/src/graphql/types/TagFolder/organization.ts +++ b/src/graphql/types/TagFolder/organization.ts @@ -5,7 +5,7 @@ import { TagFolder } from "./TagFolder"; TagFolder.implement({ fields: (t) => ({ organization: t.field({ - description: "Organization which the tag folder is associated to.", + description: "Organization which the tag folder belongs to.", resolve: async (parent, _args, ctx) => { const existingOrganization = await ctx.drizzleClient.query.organizationsTable.findFirst({ @@ -13,7 +13,7 @@ TagFolder.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag folder's organization id that isn't null.", diff --git a/src/graphql/types/TagFolder/parentFolder.ts b/src/graphql/types/TagFolder/parentFolder.ts index f842cc7455..9cda740143 100644 --- a/src/graphql/types/TagFolder/parentFolder.ts +++ b/src/graphql/types/TagFolder/parentFolder.ts @@ -4,7 +4,7 @@ import { TagFolder } from "./TagFolder"; TagFolder.implement({ fields: (t) => ({ parentFolder: t.field({ - description: "Parent folder of the tag folder.", + description: "Tag folder the tag folder is contained within.", resolve: async (parent, _args, ctx) => { if (parent.parentFolderId === null) { return null; @@ -18,7 +18,7 @@ TagFolder.implement({ operators.eq(fields.id, parentFolderId), }); - // Parent folder id existing but the associated tag folder not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Parent folder id existing but the associated tag folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingTagFolder === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag folder's parent folder id that isn't null.", diff --git a/src/graphql/types/TagFolder/tags.ts b/src/graphql/types/TagFolder/tags.ts index 03f273d771..816eddc4ab 100644 --- a/src/graphql/types/TagFolder/tags.ts +++ b/src/graphql/types/TagFolder/tags.ts @@ -45,7 +45,7 @@ TagFolder.implement({ tags: t.connection( { description: - "GraphQL connection to traverse through the tags associated to the tag folder.", + "GraphQL connection to traverse through the tags contained within the tag folder.", resolve: async (parent, args, ctx) => { const { data: parsedArgs, diff --git a/src/graphql/types/TagFolder/updater.ts b/src/graphql/types/TagFolder/updater.ts index d04916c1d3..e07458a047 100644 --- a/src/graphql/types/TagFolder/updater.ts +++ b/src/graphql/types/TagFolder/updater.ts @@ -19,7 +19,7 @@ TagFolder.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a tag folder's updater id that isn't null.", diff --git a/src/graphql/types/User/User.ts b/src/graphql/types/User/User.ts index 01d6a669e4..9794fb8456 100644 --- a/src/graphql/types/User/User.ts +++ b/src/graphql/types/User/User.ts @@ -12,7 +12,7 @@ export type User = typeof usersTable.$inferSelect; export const User = builder.objectRef<User>("User"); User.implement({ - description: "", + description: "Users are the recognized identities of clients using talawa.", fields: (t) => ({ address: t.exposeString("address", { description: "Address of the user.", diff --git a/src/graphql/types/User/creator.ts b/src/graphql/types/User/creator.ts index 05e3729e27..88f04adfcf 100755 --- a/src/graphql/types/User/creator.ts +++ b/src/graphql/types/User/creator.ts @@ -4,7 +4,7 @@ import { User } from "./User"; User.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the user.", + description: "User who first created the user.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -55,7 +55,7 @@ User.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a user's creator id that isn't null.", diff --git a/src/graphql/types/User/updater.ts b/src/graphql/types/User/updater.ts index 6280af4da9..2f94cbce85 100755 --- a/src/graphql/types/User/updater.ts +++ b/src/graphql/types/User/updater.ts @@ -55,7 +55,7 @@ User.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a user's updater id that isn't null.", diff --git a/src/graphql/types/Venue/Venue.ts b/src/graphql/types/Venue/Venue.ts index d1059903f0..f21fbfc07c 100644 --- a/src/graphql/types/Venue/Venue.ts +++ b/src/graphql/types/Venue/Venue.ts @@ -6,7 +6,8 @@ export type Venue = typeof venuesTable.$inferSelect; export const Venue = builder.objectRef<Venue>("Venue"); Venue.implement({ - description: "", + description: + "Venues are physical locations associated to organizations where they conduct their events.", fields: (t) => ({ description: t.exposeString("description", { description: "Custom information about the venue.", diff --git a/src/graphql/types/Venue/createdAt.ts b/src/graphql/types/Venue/createdAt.ts index 7566cb8e5e..b0760f10e4 100644 --- a/src/graphql/types/Venue/createdAt.ts +++ b/src/graphql/types/Venue/createdAt.ts @@ -4,7 +4,7 @@ import { Venue } from "./Venue"; Venue.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the venue was created.", + description: "Date time at the time the venue was first created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Venue/creator.ts b/src/graphql/types/Venue/creator.ts index 0cfb1f2be9..5f80172700 100644 --- a/src/graphql/types/Venue/creator.ts +++ b/src/graphql/types/Venue/creator.ts @@ -5,7 +5,7 @@ import { Venue } from "./Venue"; Venue.implement({ fields: (t) => ({ creator: t.field({ - description: "User who created the venue.", + description: "User who first created the venue.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -69,7 +69,7 @@ Venue.implement({ }, ); - // Creator id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Creator id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a venue's creator id that isn't null.", diff --git a/src/graphql/types/Venue/events.ts b/src/graphql/types/Venue/events.ts index 313e2c6367..5365a2a438 100644 --- a/src/graphql/types/Venue/events.ts +++ b/src/graphql/types/Venue/events.ts @@ -52,7 +52,7 @@ Venue.implement({ events: t.connection( { description: - "GraphQL connection to traverse through the events associated to the venue.", + "GraphQL connection to traverse through the events the venue has been booked for.", resolve: async (parent, args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Venue/organization.ts b/src/graphql/types/Venue/organization.ts index cc0a51af18..d859088f37 100644 --- a/src/graphql/types/Venue/organization.ts +++ b/src/graphql/types/Venue/organization.ts @@ -5,7 +5,7 @@ import { Venue } from "./Venue"; Venue.implement({ fields: (t) => ({ organization: t.field({ - description: "Organization associated to the venue.", + description: "Organization the venue belongs to.", resolve: async (parent, _args, ctx) => { const existingOrganization = await ctx.drizzleClient.query.organizationsTable.findFirst({ @@ -13,7 +13,7 @@ Venue.implement({ operators.eq(fields.id, parent.organizationId), }); - // Organziation id existing but the associated organization not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a venue's organization id that isn't null.", diff --git a/src/graphql/types/Venue/updater.ts b/src/graphql/types/Venue/updater.ts index fe69d8f119..ef4450d511 100644 --- a/src/graphql/types/Venue/updater.ts +++ b/src/graphql/types/Venue/updater.ts @@ -69,7 +69,7 @@ Venue.implement({ }, ); - // Updater id existing but the associated user not existing is a business logic error and means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingUser === undefined) { ctx.log.error( "Postgres select operation returned an empty array for a venue's updater id that isn't null.", diff --git a/src/graphql/types/VenueAttachment/VenueAttachment.ts b/src/graphql/types/VenueAttachment/VenueAttachment.ts index 7449acb364..626be6e9d9 100644 --- a/src/graphql/types/VenueAttachment/VenueAttachment.ts +++ b/src/graphql/types/VenueAttachment/VenueAttachment.ts @@ -7,7 +7,7 @@ export const VenueAttachment = builder.objectRef<VenueAttachment>("VenueAttachment"); VenueAttachment.implement({ - description: "", + description: "Attachment of the venue.", fields: (t) => ({ mimeType: t.exposeString("mimeType", { description: "Mime type of the attachment.", From 87d71161479b934f059a6af6006b5f17e7768a4c Mon Sep 17 00:00:00 2001 From: xoldd <xoldyckk@gmail.com> Date: Thu, 2 Jan 2025 22:16:23 +0530 Subject: [PATCH 5/5] fix issues in non root graphql resolvers --- ...ql => 20250102173648_nostalgic_vermin.sql} | 10 +- ...shot.json => 20250102173648_snapshot.json} | 37 +--- drizzle_migrations/meta/_journal.json | 4 +- pnpm-lock.yaml | 8 +- schema.graphql | 71 ++++--- src/drizzle/tables/chatMessages.ts | 14 +- src/drizzle/tables/comments.ts | 15 -- src/drizzle/tables/users.ts | 6 - .../inputs/MutationCreateChatMessageInput.ts | 13 +- src/graphql/types/Advertisement/createdAt.ts | 2 +- src/graphql/types/Advertisement/creator.ts | 2 +- src/graphql/types/Advertisement/updater.ts | 1 + src/graphql/types/AgendaFolder/createdAt.ts | 2 +- src/graphql/types/AgendaFolder/creator.ts | 2 +- src/graphql/types/AgendaFolder/event.ts | 60 +----- .../types/AgendaFolder/parentFolder.ts | 80 ------- src/graphql/types/AgendaItem/folder.ts | 71 +------ src/graphql/types/Chat/createdAt.ts | 6 +- src/graphql/types/Chat/creator.ts | 16 +- src/graphql/types/Chat/members.ts | 5 +- src/graphql/types/Chat/messages.ts | 58 +++++ src/graphql/types/Chat/updater.ts | 1 + src/graphql/types/ChatMessage/index.ts | 2 +- ...{parentChatMessage.ts => parentMessage.ts} | 14 +- src/graphql/types/Comment/downVoters.ts | 20 +- src/graphql/types/Comment/downVotesCount.ts | 18 +- src/graphql/types/Comment/index.ts | 1 - src/graphql/types/Comment/upVoters.ts | 20 +- src/graphql/types/Comment/upVotesCount.ts | 18 +- src/graphql/types/Comment/updater.ts | 118 ----------- src/graphql/types/Event/createdAt.ts | 2 +- src/graphql/types/Event/creator.ts | 2 +- src/graphql/types/Event/organization.ts | 2 +- src/graphql/types/Event/updater.ts | 1 + src/graphql/types/Event/venues.ts | 70 ++---- src/graphql/types/Fund/campaigns.ts | 1 + src/graphql/types/Fund/createdAt.ts | 2 +- src/graphql/types/Fund/creator.ts | 3 +- src/graphql/types/Fund/updater.ts | 1 + src/graphql/types/FundCampaign/createdAt.ts | 3 +- src/graphql/types/FundCampaign/creator.ts | 4 +- .../types/FundCampaign/pledgedAmount.ts | 14 -- src/graphql/types/FundCampaign/updatedAt.ts | 1 + src/graphql/types/FundCampaign/updater.ts | 2 + .../types/Mutation/createChatMessage.ts | 10 +- .../types/Mutation/createVenueBooking.ts | 5 +- .../types/Mutation/deleteVenueBooking.ts | 5 +- src/graphql/types/Mutation/signUp.ts | 8 + src/graphql/types/Mutation/updateComment.ts | 1 - .../types/Organization/advertisements.ts | 1 + src/graphql/types/Organization/chats.ts | 50 +++++ src/graphql/types/Organization/creator.ts | 46 +++- src/graphql/types/Organization/events.ts | 19 +- src/graphql/types/Organization/funds.ts | 51 +++++ src/graphql/types/Organization/members.ts | 63 +++++- src/graphql/types/Organization/pinnedPosts.ts | 16 +- .../types/Organization/pinnedPostsCount.ts | 71 ++++++- src/graphql/types/Organization/postsCount.ts | 63 +++++- src/graphql/types/Organization/tagFolders.ts | 4 +- src/graphql/types/Organization/tags.ts | 3 +- src/graphql/types/Organization/venues.ts | 3 +- src/graphql/types/Post/creator.ts | 2 +- src/graphql/types/Post/downVoters.ts | 20 +- src/graphql/types/Post/upVoters.ts | 20 +- src/graphql/types/Query/signIn.ts | 10 + src/graphql/types/Tag/assignees.ts | 199 ++++++++++++++++++ src/graphql/types/Tag/createdAt.ts | 2 +- src/graphql/types/Tag/creator.ts | 2 +- src/graphql/types/Tag/index.ts | 1 + src/graphql/types/TagFolder/creator.ts | 2 +- src/graphql/types/User/User.ts | 65 +----- src/graphql/types/User/address.ts | 50 +++++ src/graphql/types/User/birthDate.ts | 50 +++++ src/graphql/types/User/city.ts | 53 +++++ src/graphql/types/User/countryCode.ts | 51 +++++ src/graphql/types/User/creator.ts | 3 +- src/graphql/types/User/educationGrade.ts | 51 +++++ src/graphql/types/User/emailAddress.ts | 50 +++++ src/graphql/types/User/employmentStatus.ts | 51 +++++ src/graphql/types/User/homePhoneNumber.ts | 51 +++++ src/graphql/types/User/index.ts | 15 ++ .../types/User/isEmailAddressVerified.ts | 51 +++++ src/graphql/types/User/maritalStatus.ts | 51 +++++ src/graphql/types/User/mobilePhoneNumber.ts | 51 +++++ src/graphql/types/User/natalSex.ts | 51 +++++ .../types/User/organizationsWhereMember.ts | 47 ++++- src/graphql/types/User/postalCode.ts | 50 +++++ src/graphql/types/User/state.ts | 50 +++++ src/graphql/types/User/updater.ts | 4 + src/graphql/types/User/workPhoneNumber.ts | 51 +++++ src/graphql/types/Venue/Venue.ts | 12 +- src/graphql/types/Venue/createdAt.ts | 2 +- src/graphql/types/Venue/creator.ts | 2 +- src/graphql/types/Venue/events.ts | 14 +- src/utilities/TalawaGraphQLError.ts | 163 +++++++------- .../Mutation/deleteCurrentUser.test.ts | 4 +- test/routes/graphql/Query/user.test.ts | 7 + test/routes/graphql/documentNodes.ts | 21 +- test/routes/graphql/gql.tada-cache.d.ts | 4 +- test/routes/graphql/gql.tada.d.ts | 12 +- 100 files changed, 1795 insertions(+), 822 deletions(-) rename drizzle_migrations/{20241231123945_true_dorian_gray.sql => 20250102173648_nostalgic_vermin.sql} (98%) rename drizzle_migrations/meta/{20241231123945_snapshot.json => 20250102173648_snapshot.json} (99%) rename src/graphql/types/ChatMessage/{parentChatMessage.ts => parentMessage.ts} (53%) delete mode 100644 src/graphql/types/Comment/updater.ts create mode 100644 src/graphql/types/Tag/assignees.ts create mode 100644 src/graphql/types/User/address.ts create mode 100644 src/graphql/types/User/birthDate.ts create mode 100644 src/graphql/types/User/city.ts create mode 100644 src/graphql/types/User/countryCode.ts create mode 100644 src/graphql/types/User/educationGrade.ts create mode 100644 src/graphql/types/User/emailAddress.ts create mode 100644 src/graphql/types/User/employmentStatus.ts create mode 100644 src/graphql/types/User/homePhoneNumber.ts create mode 100644 src/graphql/types/User/isEmailAddressVerified.ts create mode 100644 src/graphql/types/User/maritalStatus.ts create mode 100644 src/graphql/types/User/mobilePhoneNumber.ts create mode 100644 src/graphql/types/User/natalSex.ts create mode 100644 src/graphql/types/User/postalCode.ts create mode 100644 src/graphql/types/User/state.ts create mode 100644 src/graphql/types/User/workPhoneNumber.ts diff --git a/drizzle_migrations/20241231123945_true_dorian_gray.sql b/drizzle_migrations/20250102173648_nostalgic_vermin.sql similarity index 98% rename from drizzle_migrations/20241231123945_true_dorian_gray.sql rename to drizzle_migrations/20250102173648_nostalgic_vermin.sql index eda435a61e..d47c55d186 100644 --- a/drizzle_migrations/20241231123945_true_dorian_gray.sql +++ b/drizzle_migrations/20250102173648_nostalgic_vermin.sql @@ -94,7 +94,7 @@ CREATE TABLE "chat_messages" ( "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, "creator_id" uuid, "id" uuid PRIMARY KEY NOT NULL, - "parent_chat_message_id" uuid, + "parent_message_id" uuid, "updated_at" timestamp (3) with time zone ); --> statement-breakpoint @@ -128,8 +128,7 @@ CREATE TABLE "comments" ( "creator_id" uuid, "id" uuid PRIMARY KEY NOT NULL, "post_id" uuid NOT NULL, - "updated_at" timestamp (3) with time zone, - "updater_id" uuid + "updated_at" timestamp (3) with time zone ); --> statement-breakpoint CREATE TABLE "event_attachments" ( @@ -424,7 +423,7 @@ ALTER TABLE "chat_memberships" ADD CONSTRAINT "chat_memberships_member_id_users_ ALTER TABLE "chat_memberships" ADD CONSTRAINT "chat_memberships_updater_id_users_id_fk" FOREIGN KEY ("updater_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "chat_messages" ADD CONSTRAINT "chat_messages_chat_id_chats_id_fk" FOREIGN KEY ("chat_id") REFERENCES "public"."chats"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "chat_messages" ADD CONSTRAINT "chat_messages_creator_id_users_id_fk" FOREIGN KEY ("creator_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint -ALTER TABLE "chat_messages" ADD CONSTRAINT "chat_messages_parent_chat_message_id_chat_messages_id_fk" FOREIGN KEY ("parent_chat_message_id") REFERENCES "public"."chat_messages"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint +ALTER TABLE "chat_messages" ADD CONSTRAINT "chat_messages_parent_message_id_chat_messages_id_fk" FOREIGN KEY ("parent_message_id") REFERENCES "public"."chat_messages"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "chats" ADD CONSTRAINT "chats_creator_id_users_id_fk" FOREIGN KEY ("creator_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "chats" ADD CONSTRAINT "chats_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "chats" ADD CONSTRAINT "chats_updater_id_users_id_fk" FOREIGN KEY ("updater_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint @@ -433,7 +432,6 @@ ALTER TABLE "comment_votes" ADD CONSTRAINT "comment_votes_creator_id_users_id_fk ALTER TABLE "comment_votes" ADD CONSTRAINT "comment_votes_updated_id_users_id_fk" FOREIGN KEY ("updated_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "comments" ADD CONSTRAINT "comments_creator_id_users_id_fk" FOREIGN KEY ("creator_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "comments" ADD CONSTRAINT "comments_post_id_posts_id_fk" FOREIGN KEY ("post_id") REFERENCES "public"."posts"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint -ALTER TABLE "comments" ADD CONSTRAINT "comments_updater_id_users_id_fk" FOREIGN KEY ("updater_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "event_attachments" ADD CONSTRAINT "event_attachments_creator_id_users_id_fk" FOREIGN KEY ("creator_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "event_attachments" ADD CONSTRAINT "event_attachments_event_id_events_id_fk" FOREIGN KEY ("event_id") REFERENCES "public"."events"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint ALTER TABLE "event_attachments" ADD CONSTRAINT "event_attachments_updater_id_users_id_fk" FOREIGN KEY ("updater_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE cascade;--> statement-breakpoint @@ -545,7 +543,7 @@ CREATE INDEX "chat_memberships_role_index" ON "chat_memberships" USING btree ("r CREATE INDEX "chat_messages_chat_id_index" ON "chat_messages" USING btree ("chat_id");--> statement-breakpoint CREATE INDEX "chat_messages_created_at_index" ON "chat_messages" USING btree ("created_at");--> statement-breakpoint CREATE INDEX "chat_messages_creator_id_index" ON "chat_messages" USING btree ("creator_id");--> statement-breakpoint -CREATE INDEX "chat_messages_parent_chat_message_id_index" ON "chat_messages" USING btree ("parent_chat_message_id");--> statement-breakpoint +CREATE INDEX "chat_messages_parent_message_id_index" ON "chat_messages" USING btree ("parent_message_id");--> statement-breakpoint CREATE INDEX "chats_creator_id_index" ON "chats" USING btree ("creator_id");--> statement-breakpoint CREATE INDEX "chats_name_index" ON "chats" USING btree ("name");--> statement-breakpoint CREATE INDEX "chats_organization_id_index" ON "chats" USING btree ("organization_id");--> statement-breakpoint diff --git a/drizzle_migrations/meta/20241231123945_snapshot.json b/drizzle_migrations/meta/20250102173648_snapshot.json similarity index 99% rename from drizzle_migrations/meta/20241231123945_snapshot.json rename to drizzle_migrations/meta/20250102173648_snapshot.json index 789d83031d..b0b00c3bdb 100644 --- a/drizzle_migrations/meta/20241231123945_snapshot.json +++ b/drizzle_migrations/meta/20250102173648_snapshot.json @@ -1,5 +1,5 @@ { - "id": "62950bfb-fb43-4883-a2df-9dcc9aaf1687", + "id": "2bd701f6-2186-44c7-93b4-56dc4ce1e21a", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -1457,8 +1457,8 @@ "primaryKey": true, "notNull": true }, - "parent_chat_message_id": { - "name": "parent_chat_message_id", + "parent_message_id": { + "name": "parent_message_id", "type": "uuid", "primaryKey": false, "notNull": false @@ -1516,11 +1516,11 @@ "method": "btree", "with": {} }, - "chat_messages_parent_chat_message_id_index": { - "name": "chat_messages_parent_chat_message_id_index", + "chat_messages_parent_message_id_index": { + "name": "chat_messages_parent_message_id_index", "columns": [ { - "expression": "parent_chat_message_id", + "expression": "parent_message_id", "isExpression": false, "asc": true, "nulls": "last" @@ -1559,12 +1559,12 @@ "onDelete": "set null", "onUpdate": "cascade" }, - "chat_messages_parent_chat_message_id_chat_messages_id_fk": { - "name": "chat_messages_parent_chat_message_id_chat_messages_id_fk", + "chat_messages_parent_message_id_chat_messages_id_fk": { + "name": "chat_messages_parent_message_id_chat_messages_id_fk", "tableFrom": "chat_messages", "tableTo": "chat_messages", "columnsFrom": [ - "parent_chat_message_id" + "parent_message_id" ], "columnsTo": [ "id" @@ -1965,12 +1965,6 @@ "type": "timestamp (3) with time zone", "primaryKey": false, "notNull": false - }, - "updater_id": { - "name": "updater_id", - "type": "uuid", - "primaryKey": false, - "notNull": false } }, "indexes": { @@ -2046,19 +2040,6 @@ ], "onDelete": "cascade", "onUpdate": "cascade" - }, - "comments_updater_id_users_id_fk": { - "name": "comments_updater_id_users_id_fk", - "tableFrom": "comments", - "tableTo": "users", - "columnsFrom": [ - "updater_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "cascade" } }, "compositePrimaryKeys": {}, diff --git a/drizzle_migrations/meta/_journal.json b/drizzle_migrations/meta/_journal.json index c6465c642a..de1163b97c 100644 --- a/drizzle_migrations/meta/_journal.json +++ b/drizzle_migrations/meta/_journal.json @@ -5,8 +5,8 @@ { "idx": 0, "version": "7", - "when": 1735648785424, - "tag": "20241231123945_true_dorian_gray", + "when": 1735839408264, + "tag": "20250102173648_nostalgic_vermin", "breakpoints": true } ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5061ad56ca..f24a000b6f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -802,8 +802,8 @@ packages: resolution: {integrity: sha512-r0tJ3ZOkMd9xsu3VRfqlFR6cz0V/jFYRswAIpC+m/DIfAUXq7g8N7wTAlhSANySXYGKzGryfDXwtwsY8TxEIDw==} engines: {node: '>=18.0.0', npm: '>=9.0.0'} - '@fastify/accept-negotiator@2.0.0': - resolution: {integrity: sha512-/Sce/kBzuTxIq5tJh85nVNOq9wKD8s+viIgX0fFMDBdw95gnpf53qmF1oBgJym3cPFliWUuSloVg/1w/rH0FcQ==} + '@fastify/accept-negotiator@2.0.1': + resolution: {integrity: sha512-/c/TW2bO/v9JeEgoD/g1G5GxGeCF1Hafdf79WPmUlgYiBXummY0oX3VVq4yFkKKVBKDNlaDUYoab7g38RpPqCQ==} '@fastify/ajv-compiler@4.0.1': resolution: {integrity: sha512-DxrBdgsjNLP0YM6W5Hd6/Fmj43S8zMKiFJYgi+Ri3htTGAowPVG/tG1wpnWLMjufEnehRivUCKZ1pLDIoZdTuw==} @@ -3356,7 +3356,7 @@ snapshots: '@faker-js/faker@9.3.0': {} - '@fastify/accept-negotiator@2.0.0': {} + '@fastify/accept-negotiator@2.0.1': {} '@fastify/ajv-compiler@4.0.1': dependencies: @@ -3408,7 +3408,7 @@ snapshots: '@fastify/static@8.0.3': dependencies: - '@fastify/accept-negotiator': 2.0.0 + '@fastify/accept-negotiator': 2.0.1 '@fastify/send': 3.3.0 content-disposition: 0.5.4 fastify-plugin: 5.0.1 diff --git a/schema.graphql b/schema.graphql index 907dab11ea..8112b59437 100644 --- a/schema.graphql +++ b/schema.graphql @@ -2,10 +2,10 @@ type Advertisement { """Array of attachments.""" attachments: [AdvertisementAttachment!] - """Date time at the time the advertisement was first created.""" + """Date time at the time the advertisement was created.""" createdAt: DateTime - """User who first created the advertisement.""" + """User who created the advertisement.""" creator: User """Custom information about the advertisement.""" @@ -57,10 +57,10 @@ type AgendaFolder { """ childFolders(after: String, before: String, first: Int, last: Int): AgendaFolderChildFoldersConnection - """Date time at the time the agenda folder was first created.""" + """Date time at the time the agenda folder was created.""" createdAt: DateTime - """User who first created the agenda folder.""" + """User who created the agenda folder.""" creator: User """ @@ -131,7 +131,7 @@ type AgendaItem { """Duration of the agenda item.""" duration: String - """Agenda folder associated to the agenda item.""" + """Agenda folder within which the agenda item in contained.""" event: AgendaFolder """Global identifier of the agenda item.""" @@ -189,7 +189,7 @@ type Chat { """Date time at the time the chat was first created.""" createdAt: DateTime - """User who first created the chat.""" + """User who created the chat.""" creator: User """Custom information about the chat.""" @@ -255,8 +255,8 @@ type ChatMessage { """Global identifier of the chat message.""" id: ID! - """Parent chat message of the chat message.""" - parentChatMessage: ChatMessage + """Parent message of the chat message.""" + parentMessage: ChatMessage """Date time at the time the chat message was last updated.""" updatedAt: DateTime @@ -308,9 +308,6 @@ type Comment { """Date time at the time the comment was last updated.""" updatedAt: DateTime - - """User who last updated the comment.""" - updater: User } """""" @@ -367,10 +364,10 @@ type Event { """Array of attachments.""" attachments: [EventAttachment!] - """Date time at the time the event was first created.""" + """Date time at the time the event was created.""" createdAt: DateTime - """User who first created the event.""" + """User who created the event.""" creator: User """Custom information about the event.""" @@ -439,10 +436,10 @@ type Fund { """GraphQL connection to traverse through the campaigns for the fund.""" campaigns(after: String, before: String, first: Int, last: Int): FundCampaignsConnection - """Date time at the time the fund was first created.""" + """Date time at the time the fund was created.""" createdAt: DateTime - """User who first created the fund.""" + """User who created the fund.""" creator: User """Global identifier of the fund.""" @@ -465,10 +462,10 @@ type Fund { } type FundCampaign { - """Date time at the time the fund campaign was first created.""" + """Date time at the time the fund campaign was created.""" createdAt: DateTime - """User who first created the fund campaign.""" + """User who created the fund campaign.""" creator: User """Currency code of the fund campaign.""" @@ -1314,8 +1311,8 @@ input MutationCreateChatMessageInput { """Global identifier of the associated chat.""" chatId: ID! - """Global identifier of the associated parent chat message.""" - parentChatMessageId: ID! + """Global identifier of the associated parent message.""" + parentMessageId: ID! } """""" @@ -2221,7 +2218,7 @@ type Organization { """Date time at the time the organization was created.""" createdAt: DateTime - """User who first created the organization.""" + """User who created the organization.""" creator: User """Custom information about the organization.""" @@ -2450,7 +2447,7 @@ type Post { """Date time at the time the post was created.""" createdAt: DateTime - """User who first created the post.""" + """User who created the post.""" creator: User """ @@ -2721,10 +2718,15 @@ input SubscriptionChatMessageCreateInput { } type Tag { - """Date time at the time the tag was first created.""" + """ + GraphQL connection to traverse through the users that are assignees of the tag. + """ + assignees(after: String, before: String, first: Int, last: Int): TagAssigneesConnection + + """Date time at the time the tag was created.""" createdAt: DateTime - """User who first created the tag.""" + """User who created the tag.""" creator: User """Tag folder the tag is contained within.""" @@ -2746,6 +2748,18 @@ type Tag { updater: User } +"""""" +type TagAssigneesConnection { + edges: [TagAssigneesConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type TagAssigneesConnectionEdge { + cursor: String! + node: User +} + type TagFolder { """ GraphQL connection to traverse through the tag folders contained within the tag folder. @@ -2755,7 +2769,7 @@ type TagFolder { """Date time at the time the tag folder was created.""" createdAt: DateTime - """User who first created the tag folder.""" + """User who created the tag folder.""" creator: User """Global identifier of the tag folder.""" @@ -2831,7 +2845,7 @@ type User { """Date time at the time the user was created.""" createdAt: DateTime - """User who first created the user.""" + """User who created the user.""" creator: User """Custom information about the user.""" @@ -2958,10 +2972,13 @@ enum UserRole { } type Venue { - """Date time at the time the venue was first created.""" + """Array of attachments.""" + attachments: [VenueAttachment!] + + """Date time at the time the venue was created.""" createdAt: DateTime - """User who first created the venue.""" + """User who created the venue.""" creator: User """Custom information about the venue.""" diff --git a/src/drizzle/tables/chatMessages.ts b/src/drizzle/tables/chatMessages.ts index 892c00f91d..8bb73881f7 100644 --- a/src/drizzle/tables/chatMessages.ts +++ b/src/drizzle/tables/chatMessages.ts @@ -55,7 +55,7 @@ export const chatMessagesTable = pgTable( /** * Foreign key reference to the id of the chat message the chat message is associated to. */ - parentChatMessageId: uuid("parent_chat_message_id").references( + parentMessageId: uuid("parent_message_id").references( (): AnyPgColumn => chatMessagesTable.id, { onDelete: "set null", @@ -77,7 +77,7 @@ export const chatMessagesTable = pgTable( index().on(self.chatId), index().on(self.createdAt), index().on(self.creatorId), - index().on(self.parentChatMessageId), + index().on(self.parentMessageId), ], ); @@ -95,8 +95,8 @@ export const chatMessagesTableRelations = relations( /** * One to many relationship from `chat_messages` table to `chat_messages` table. */ - chatMessagesWhereParentChatMessage: many(chatMessagesTable, { - relationName: "chat_messages.id:chat_messages.parent_chat_message_id", + chatMessagesWhereParentMessage: many(chatMessagesTable, { + relationName: "chat_messages.id:chat_messages.parent_message_id", }), /** * Many to one relationship from `chat_messages` table to `users` table. @@ -109,10 +109,10 @@ export const chatMessagesTableRelations = relations( /** * Many to one relationship from `chat_messages` table to `chat_messages` table. */ - parentChatMessage: one(chatMessagesTable, { - fields: [chatMessagesTable.parentChatMessageId], + parentMessage: one(chatMessagesTable, { + fields: [chatMessagesTable.parentMessageId], references: [chatMessagesTable.id], - relationName: "chat_messages.id:chat_messages.parent_chat_message_id", + relationName: "chat_messages.id:chat_messages.parent_message_id", }), }), ); diff --git a/src/drizzle/tables/comments.ts b/src/drizzle/tables/comments.ts index a676564042..e1434143eb 100755 --- a/src/drizzle/tables/comments.ts +++ b/src/drizzle/tables/comments.ts @@ -56,13 +56,6 @@ export const commentsTable = pgTable( }) .$defaultFn(() => sql`${null}`) .$onUpdate(() => new Date()), - /** - * Foreign key reference to the id of the user who last updated the comment. - */ - updaterId: uuid("updater_id").references(() => usersTable.id, { - onDelete: "set null", - onUpdate: "cascade", - }), }, (self) => [ index().on(self.createdAt), @@ -96,14 +89,6 @@ export const commentsTableRelations = relations( references: [postsTable.id], relationName: "comments.post_id:posts.id", }), - /** - * Many to one relationship from `comments` table to `users` table. - */ - updater: one(usersTable, { - fields: [commentsTable.updaterId], - references: [usersTable.id], - relationName: "comments.updater_id:users.id", - }), }), ); diff --git a/src/drizzle/tables/users.ts b/src/drizzle/tables/users.ts index 831dd69525..f655802adf 100755 --- a/src/drizzle/tables/users.ts +++ b/src/drizzle/tables/users.ts @@ -324,12 +324,6 @@ export const usersTableRelations = relations(usersTable, ({ many, one }) => ({ commentsWhereCreator: many(commentsTable, { relationName: "comments.creator_id:users.id", }), - /** - * One to many relationship from `users` table to `comments` table. - */ - commentsWhereUpdater: many(commentsTable, { - relationName: "comments.updater_id:users.id", - }), /** * One to many relationship from `users` table to `comment_votes` table. */ diff --git a/src/graphql/inputs/MutationCreateChatMessageInput.ts b/src/graphql/inputs/MutationCreateChatMessageInput.ts index 8c741d918e..0b43b92ffd 100644 --- a/src/graphql/inputs/MutationCreateChatMessageInput.ts +++ b/src/graphql/inputs/MutationCreateChatMessageInput.ts @@ -9,11 +9,10 @@ export const mutationCreateChatMessageInputSchema = chatId: true, }) .extend({ - parentChatMessageId: - chatMessagesTableInsertSchema.shape.parentChatMessageId - .unwrap() - .unwrap() - .optional(), + parentMessageId: chatMessagesTableInsertSchema.shape.parentMessageId + .unwrap() + .unwrap() + .optional(), }); export const MutationCreateChatMessageInput = builder @@ -31,8 +30,8 @@ export const MutationCreateChatMessageInput = builder description: "Global identifier of the associated chat.", required: true, }), - parentChatMessageId: t.id({ - description: "Global identifier of the associated parent chat message.", + parentMessageId: t.id({ + description: "Global identifier of the associated parent message.", required: true, }), }), diff --git a/src/graphql/types/Advertisement/createdAt.ts b/src/graphql/types/Advertisement/createdAt.ts index 266005fe31..1a33d5fb4a 100644 --- a/src/graphql/types/Advertisement/createdAt.ts +++ b/src/graphql/types/Advertisement/createdAt.ts @@ -4,7 +4,7 @@ import { Advertisement } from "./Advertisement"; Advertisement.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the advertisement was first created.", + description: "Date time at the time the advertisement was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Advertisement/creator.ts b/src/graphql/types/Advertisement/creator.ts index 98c843e8a0..5de95505a3 100644 --- a/src/graphql/types/Advertisement/creator.ts +++ b/src/graphql/types/Advertisement/creator.ts @@ -5,7 +5,7 @@ import { Advertisement } from "./Advertisement"; Advertisement.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the advertisement.", + description: "User who created the advertisement.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Advertisement/updater.ts b/src/graphql/types/Advertisement/updater.ts index 8dc184851c..1c0a53a59b 100644 --- a/src/graphql/types/Advertisement/updater.ts +++ b/src/graphql/types/Advertisement/updater.ts @@ -74,6 +74,7 @@ Advertisement.implement({ ctx.log.error( "Postgres select operation returned an empty array for an advertisement's updater id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/AgendaFolder/createdAt.ts b/src/graphql/types/AgendaFolder/createdAt.ts index 966b86e852..9ac93168dc 100644 --- a/src/graphql/types/AgendaFolder/createdAt.ts +++ b/src/graphql/types/AgendaFolder/createdAt.ts @@ -4,7 +4,7 @@ import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the agenda folder was first created.", + description: "Date time at the time the agenda folder was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/AgendaFolder/creator.ts b/src/graphql/types/AgendaFolder/creator.ts index 6384680ec6..5c76154951 100644 --- a/src/graphql/types/AgendaFolder/creator.ts +++ b/src/graphql/types/AgendaFolder/creator.ts @@ -5,7 +5,7 @@ import { AgendaFolder } from "./AgendaFolder"; AgendaFolder.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the agenda folder.", + description: "User who created the agenda folder.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/AgendaFolder/event.ts b/src/graphql/types/AgendaFolder/event.ts index 97117697f8..36cd4068eb 100644 --- a/src/graphql/types/AgendaFolder/event.ts +++ b/src/graphql/types/AgendaFolder/event.ts @@ -8,54 +8,14 @@ AgendaFolder.implement({ description: "Event for which the agenda folder contains agenda items constituting a part of the agenda.", resolve: async (parent, _args, ctx) => { - if (!ctx.currentClient.isAuthenticated) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - const currentUserId = ctx.currentClient.user.id; - - const [currentUser, existingEvent] = await Promise.all([ - ctx.drizzleClient.query.usersTable.findFirst({ - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.id, currentUserId), - }), - ctx.drizzleClient.query.eventsTable.findFirst({ + const existingEvent = + await ctx.drizzleClient.query.eventsTable.findFirst({ where: (fields, operators) => operators.eq(fields.id, parent.eventId), with: { eventAttachmentsWhereEvent: true, - organization: { - columns: { - countryCode: true, - }, - with: { - organizationMembershipsWhereOrganization: { - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.memberId, currentUserId), - }, - }, - }, - }, - }), - ]); - - if (currentUser === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", }, }); - } // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingEvent === undefined) { @@ -70,22 +30,6 @@ AgendaFolder.implement({ }); } - const currentUserOrganizationMembership = - existingEvent.organization - .organizationMembershipsWhereOrganization[0]; - - if ( - currentUser.role !== "administrator" && - (currentUserOrganizationMembership === undefined || - currentUserOrganizationMembership.role !== "administrator") - ) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthorized_action", - }, - }); - } - return Object.assign(existingEvent, { attachments: existingEvent.eventAttachmentsWhereEvent, }); diff --git a/src/graphql/types/AgendaFolder/parentFolder.ts b/src/graphql/types/AgendaFolder/parentFolder.ts index 9b9a35c126..33576b6909 100644 --- a/src/graphql/types/AgendaFolder/parentFolder.ts +++ b/src/graphql/types/AgendaFolder/parentFolder.ts @@ -7,86 +7,6 @@ AgendaFolder.implement({ description: "Agenda folder that is a parent folder to the agenda folder.", resolve: async (parent, _args, ctx) => { - if (!ctx.currentClient.isAuthenticated) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - const currentUserId = ctx.currentClient.user.id; - - const [currentUser, existingEvent] = await Promise.all([ - ctx.drizzleClient.query.usersTable.findFirst({ - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.id, currentUserId), - }), - ctx.drizzleClient.query.eventsTable.findFirst({ - columns: { - startAt: true, - }, - where: (fields, operators) => - operators.eq(fields.id, parent.eventId), - with: { - organization: { - columns: { - countryCode: true, - }, - with: { - organizationMembershipsWhereOrganization: { - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.memberId, currentUserId), - }, - }, - }, - }, - }), - ]); - - if (currentUser === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - // Event id existing but the associated event not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. - if (existingEvent === undefined) { - ctx.log.error( - "Postgres select operation returned an empty array for an agenda folder's event id that isn't null.", - ); - - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - }); - } - - const currentUserOrganizationMembership = - existingEvent.organization - .organizationMembershipsWhereOrganization[0]; - - if ( - currentUser.role !== "administrator" && - (currentUserOrganizationMembership === undefined || - currentUserOrganizationMembership.role !== "administrator") - ) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthorized_action", - }, - }); - } - if (parent.parentFolderId === null) { return null; } diff --git a/src/graphql/types/AgendaItem/folder.ts b/src/graphql/types/AgendaItem/folder.ts index b49de232da..6c3b20f5bd 100644 --- a/src/graphql/types/AgendaItem/folder.ts +++ b/src/graphql/types/AgendaItem/folder.ts @@ -5,62 +5,13 @@ import { AgendaItem } from "./AgendaItem"; AgendaItem.implement({ fields: (t) => ({ event: t.field({ - description: "Agenda folder associated to the agenda item.", + description: "Agenda folder within which the agenda item in contained.", resolve: async (parent, _args, ctx) => { - if (!ctx.currentClient.isAuthenticated) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - const currentUserId = ctx.currentClient.user.id; - - const [currentUser, existingAgendaFolder] = await Promise.all([ - ctx.drizzleClient.query.usersTable.findFirst({ - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.id, currentUserId), - }), - ctx.drizzleClient.query.agendaFoldersTable.findFirst({ + const existingAgendaFolder = + await ctx.drizzleClient.query.agendaFoldersTable.findFirst({ where: (fields, operators) => operators.eq(fields.id, parent.folderId), - with: { - event: { - columns: { - startAt: true, - }, - with: { - organization: { - columns: { - countryCode: true, - }, - with: { - organizationMembershipsWhereOrganization: { - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.memberId, currentUserId), - }, - }, - }, - }, - }, - }, - }), - ]); - - if (currentUser === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, }); - } // Parent folder id existing but the associated agenda folder not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingAgendaFolder === undefined) { @@ -75,22 +26,6 @@ AgendaItem.implement({ }); } - const currentUserOrganizationMembership = - existingAgendaFolder.event.organization - .organizationMembershipsWhereOrganization[0]; - - if ( - currentUser.role !== "administrator" && - (currentUserOrganizationMembership === undefined || - currentUserOrganizationMembership.role !== "administrator") - ) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthorized_action", - }, - }); - } - return existingAgendaFolder; }, type: AgendaFolder, diff --git a/src/graphql/types/Chat/createdAt.ts b/src/graphql/types/Chat/createdAt.ts index 8118bbcf10..996cf022ce 100644 --- a/src/graphql/types/Chat/createdAt.ts +++ b/src/graphql/types/Chat/createdAt.ts @@ -49,15 +49,11 @@ Chat.implement({ const currentUserOrganizationMembership = currentUser.organizationMembershipsWhereMember[0]; - const currentUserChatMembership = - currentUser.chatMembershipsWhereMember[0]; if ( currentUser.role !== "administrator" && (currentUserOrganizationMembership === undefined || - (currentUserOrganizationMembership.role !== "administrator" && - (currentUserChatMembership === undefined || - currentUserChatMembership.role !== "administrator"))) + currentUserOrganizationMembership.role !== "administrator") ) { throw new TalawaGraphQLError({ extensions: { diff --git a/src/graphql/types/Chat/creator.ts b/src/graphql/types/Chat/creator.ts index 5e8f6672f5..90d841696d 100644 --- a/src/graphql/types/Chat/creator.ts +++ b/src/graphql/types/Chat/creator.ts @@ -5,7 +5,7 @@ import { Chat } from "./Chat"; Chat.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the chat.", + description: "User who created the chat.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -19,13 +19,6 @@ Chat.implement({ const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ with: { - chatMembershipsWhereMember: { - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.chatId, parent.id), - }, organizationMembershipsWhereMember: { columns: { role: true, @@ -47,15 +40,11 @@ Chat.implement({ const currentUserOrganizationMembership = currentUser.organizationMembershipsWhereMember[0]; - const currentUserChatMembership = - currentUser.chatMembershipsWhereMember[0]; if ( currentUser.role !== "administrator" && (currentUserOrganizationMembership === undefined || - (currentUserOrganizationMembership.role !== "administrator" && - (currentUserChatMembership === undefined || - currentUserChatMembership.role !== "administrator"))) + currentUserOrganizationMembership.role !== "administrator") ) { throw new TalawaGraphQLError({ extensions: { @@ -85,6 +74,7 @@ Chat.implement({ ctx.log.error( "Postgres select operation returned an empty array for a chat's creator id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/Chat/members.ts b/src/graphql/types/Chat/members.ts index afe9b8d43d..63bfcbfd72 100644 --- a/src/graphql/types/Chat/members.ts +++ b/src/graphql/types/Chat/members.ts @@ -82,12 +82,10 @@ Chat.implement({ ? [ asc(chatMembershipsTable.createdAt), asc(chatMembershipsTable.memberId), - asc(chatMembershipsTable.chatId), ] : [ desc(chatMembershipsTable.createdAt), desc(chatMembershipsTable.memberId), - desc(chatMembershipsTable.chatId), ]; let where: SQL | undefined; @@ -133,7 +131,6 @@ Chat.implement({ ), ), eq(chatMembershipsTable.chatId, parent.id), - or( and( eq(chatMembershipsTable.createdAt, cursor.createdAt), @@ -178,7 +175,7 @@ Chat.implement({ createCursor: (chatMembership) => Buffer.from( JSON.stringify({ - createdAt: chatMembership.createdAt, + createdAt: chatMembership.createdAt.toISOString(), memberId: chatMembership.memberId, }), ).toString("base64url"), diff --git a/src/graphql/types/Chat/messages.ts b/src/graphql/types/Chat/messages.ts index 53ee411449..6cacefa0d9 100644 --- a/src/graphql/types/Chat/messages.ts +++ b/src/graphql/types/Chat/messages.ts @@ -50,6 +50,14 @@ Chat.implement({ description: "GraphQL connection to traverse through the messages created within the chat.", resolve: async (parent, args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + const { data: parsedArgs, error, @@ -68,6 +76,56 @@ Chat.implement({ }); } + const currentUserId = ctx.currentClient.user.id; + + const currentUser = + await ctx.drizzleClient.query.usersTable.findFirst({ + with: { + chatMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.chatId, parent.id), + }, + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.organizationId), + }, + }, + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + const currentUserChatMembership = + currentUser.chatMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + (currentUserOrganizationMembership === undefined || + (currentUserOrganizationMembership.role !== "administrator" && + currentUserChatMembership === undefined)) + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + const { cursor, isInversed, limit } = parsedArgs; const orderBy = isInversed diff --git a/src/graphql/types/Chat/updater.ts b/src/graphql/types/Chat/updater.ts index ea967a2051..a0b49f0222 100644 --- a/src/graphql/types/Chat/updater.ts +++ b/src/graphql/types/Chat/updater.ts @@ -85,6 +85,7 @@ Chat.implement({ ctx.log.error( "Postgres select operation returned an empty array for a chat's updater id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/ChatMessage/index.ts b/src/graphql/types/ChatMessage/index.ts index 5ffcf6090b..a054849d22 100644 --- a/src/graphql/types/ChatMessage/index.ts +++ b/src/graphql/types/ChatMessage/index.ts @@ -1,4 +1,4 @@ import "./ChatMessage"; import "./chat"; import "./creator"; -import "./parentChatMessage"; +import "./parentMessage"; diff --git a/src/graphql/types/ChatMessage/parentChatMessage.ts b/src/graphql/types/ChatMessage/parentMessage.ts similarity index 53% rename from src/graphql/types/ChatMessage/parentChatMessage.ts rename to src/graphql/types/ChatMessage/parentMessage.ts index 0eca38f8c2..818b240ca6 100644 --- a/src/graphql/types/ChatMessage/parentChatMessage.ts +++ b/src/graphql/types/ChatMessage/parentMessage.ts @@ -3,25 +3,25 @@ import { ChatMessage } from "./ChatMessage"; ChatMessage.implement({ fields: (t) => ({ - parentChatMessage: t.field({ - description: "Parent chat message of the chat message.", + parentMessage: t.field({ + description: "Parent message of the chat message.", resolve: async (parent, _args, ctx) => { - if (parent.parentChatMessageId === null) { + if (parent.parentMessageId === null) { return null; } - const parentChatMessageId = parent.parentChatMessageId; + const parentMessageId = parent.parentMessageId; const existingChatMessage = await ctx.drizzleClient.query.chatMessagesTable.findFirst({ where: (fields, operators) => - operators.eq(fields.id, parentChatMessageId), + operators.eq(fields.id, parentMessageId), }); - // Parent chat message id existing but the associated chat message not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. + // Parent message id existing but the associated chat message not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingChatMessage === undefined) { ctx.log.error( - "Postgres select operation returned an empty array for a chat message's parent chat message id that isn't null.", + "Postgres select operation returned an empty array for a chat message's parent message id that isn't null.", ); throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Comment/downVoters.ts b/src/graphql/types/Comment/downVoters.ts index 3ffc774850..c929473692 100644 --- a/src/graphql/types/Comment/downVoters.ts +++ b/src/graphql/types/Comment/downVoters.ts @@ -51,10 +51,15 @@ const downVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema }; }); -const cursorSchema = z.object({ - createdAt: commentVotesTableInsertSchema.shape.createdAt.unwrap(), - creatorId: commentVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), -}); +const cursorSchema = z + .object({ + createdAt: z.string().datetime(), + creatorId: commentVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), + }) + .transform((arg) => ({ + createdAt: new Date(arg.createdAt), + creatorId: arg.creatorId, + })); Comment.implement({ fields: (t) => ({ @@ -104,6 +109,7 @@ Comment.implement({ .from(commentVotesTable) .where( and( + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.createdAt, cursor.createdAt), eq(commentVotesTable.creatorId, cursor.creatorId), eq(commentVotesTable.commentId, parent.id), @@ -111,6 +117,7 @@ Comment.implement({ ), ), ), + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.commentId, parent.id), eq(commentVotesTable.type, "down_vote"), or( @@ -137,6 +144,7 @@ Comment.implement({ .from(commentVotesTable) .where( and( + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.createdAt, cursor.createdAt), eq(commentVotesTable.creatorId, cursor.creatorId), eq(commentVotesTable.commentId, parent.id), @@ -144,6 +152,7 @@ Comment.implement({ ), ), ), + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.commentId, parent.id), eq(commentVotesTable.type, "down_vote"), or( @@ -194,12 +203,13 @@ Comment.implement({ createCursor: (vote) => Buffer.from( JSON.stringify({ - createdAt: vote.createdAt, + createdAt: vote.createdAt.toISOString(), creatorId: vote.creatorId, }), ).toString("base64url"), createNode: (vote) => vote.creator, parsedArgs, + // None of the comment votes below contain a `creator` field with `null` as the value because of the sql query logic. This filter operation is here just to prevent type errors. rawNodes: commentVotes.filter( ( vote, diff --git a/src/graphql/types/Comment/downVotesCount.ts b/src/graphql/types/Comment/downVotesCount.ts index 65c501c068..9260c61041 100644 --- a/src/graphql/types/Comment/downVotesCount.ts +++ b/src/graphql/types/Comment/downVotesCount.ts @@ -1,6 +1,5 @@ import { and, count, eq } from "drizzle-orm"; import { commentVotesTable } from "~/src/drizzle/tables/commentVotes"; -import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -8,7 +7,7 @@ Comment.implement({ downVotesCount: t.field({ description: "Total number of down votes on the comment.", resolve: async (parent, _args, ctx) => { - const [commentVotesCount] = await ctx.drizzleClient + const [commentVote] = await ctx.drizzleClient .select({ count: count(), }) @@ -20,20 +19,11 @@ Comment.implement({ ), ); - // Selected postgres aggregate not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. - if (commentVotesCount === undefined) { - ctx.log.error( - "Postgres aggregate select operation unexpectedly returned an empty array instead of throwing an error.", - ); - - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - }); + if (commentVote === undefined) { + return 0; } - return commentVotesCount.count; + return commentVote.count; }, type: "Int", }), diff --git a/src/graphql/types/Comment/index.ts b/src/graphql/types/Comment/index.ts index b9b62636c2..5d00041906 100644 --- a/src/graphql/types/Comment/index.ts +++ b/src/graphql/types/Comment/index.ts @@ -5,4 +5,3 @@ import "./downVotesCount"; import "./post"; import "./upVoters"; import "./upVotesCount"; -import "./updater"; diff --git a/src/graphql/types/Comment/upVoters.ts b/src/graphql/types/Comment/upVoters.ts index ed190f2067..dc72806ba7 100644 --- a/src/graphql/types/Comment/upVoters.ts +++ b/src/graphql/types/Comment/upVoters.ts @@ -51,10 +51,15 @@ const upVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema }; }); -const cursorSchema = z.object({ - createdAt: commentVotesTableInsertSchema.shape.createdAt.unwrap(), - creatorId: commentVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), -}); +const cursorSchema = z + .object({ + createdAt: z.string().datetime(), + creatorId: commentVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), + }) + .transform((arg) => ({ + createdAt: new Date(arg.createdAt), + creatorId: arg.creatorId, + })); Comment.implement({ fields: (t) => ({ @@ -104,6 +109,7 @@ Comment.implement({ .from(commentVotesTable) .where( and( + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.createdAt, cursor.createdAt), eq(commentVotesTable.creatorId, cursor.creatorId), eq(commentVotesTable.commentId, parent.id), @@ -111,6 +117,7 @@ Comment.implement({ ), ), ), + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.commentId, parent.id), eq(commentVotesTable.type, "up_vote"), or( @@ -137,6 +144,7 @@ Comment.implement({ .from(commentVotesTable) .where( and( + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.createdAt, cursor.createdAt), eq(commentVotesTable.creatorId, cursor.creatorId), eq(commentVotesTable.commentId, parent.id), @@ -144,6 +152,7 @@ Comment.implement({ ), ), ), + ne(commentVotesTable.creatorId, sql`${null}`), eq(commentVotesTable.commentId, parent.id), eq(commentVotesTable.type, "up_vote"), or( @@ -194,12 +203,13 @@ Comment.implement({ createCursor: (vote) => Buffer.from( JSON.stringify({ - createdAt: vote.createdAt, + createdAt: vote.createdAt.toISOString(), creatorId: vote.creatorId, }), ).toString("base64url"), createNode: (vote) => vote.creator, parsedArgs, + // None of the comment votes below contain a `creator` field with `null` as the value because of the sql query logic. This filter operation is here just to prevent type errors. rawNodes: commentVotes.filter( ( vote, diff --git a/src/graphql/types/Comment/upVotesCount.ts b/src/graphql/types/Comment/upVotesCount.ts index 9772b76e6b..e4f04440df 100644 --- a/src/graphql/types/Comment/upVotesCount.ts +++ b/src/graphql/types/Comment/upVotesCount.ts @@ -1,6 +1,5 @@ import { and, count, eq } from "drizzle-orm"; import { commentVotesTable } from "~/src/drizzle/tables/commentVotes"; -import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Comment } from "./Comment"; Comment.implement({ @@ -8,7 +7,7 @@ Comment.implement({ upVotesCount: t.field({ description: "Total number of up votes on the comment.", resolve: async (parent, _args, ctx) => { - const [commentVotesCount] = await ctx.drizzleClient + const [commentVote] = await ctx.drizzleClient .select({ count: count(), }) @@ -20,20 +19,11 @@ Comment.implement({ ), ); - // Selected postgres aggregate not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. - if (commentVotesCount === undefined) { - ctx.log.error( - "Postgres aggregate select operation unexpectedly returned an empty array instead of throwing an error.", - ); - - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - }); + if (commentVote === undefined) { + return 0; } - return commentVotesCount.count; + return commentVote.count; }, type: "Int", }), diff --git a/src/graphql/types/Comment/updater.ts b/src/graphql/types/Comment/updater.ts deleted file mode 100644 index 9afd432f1a..0000000000 --- a/src/graphql/types/Comment/updater.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { User } from "~/src/graphql/types/User/User"; -import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; -import { Comment } from "./Comment"; - -Comment.implement({ - fields: (t) => ({ - updater: t.field({ - description: "User who last updated the comment.", - resolve: async (parent, _args, ctx) => { - if (!ctx.currentClient.isAuthenticated) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - const currentUserId = ctx.currentClient.user.id; - - const [currentUser, existingPost] = await Promise.all([ - ctx.drizzleClient.query.usersTable.findFirst({ - where: (fields, operators) => - operators.eq(fields.id, currentUserId), - }), - ctx.drizzleClient.query.postsTable.findFirst({ - columns: { - pinnedAt: true, - }, - with: { - organization: { - columns: { - countryCode: true, - }, - with: { - organizationMembershipsWhereOrganization: { - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.memberId, currentUserId), - }, - }, - }, - }, - where: (fields, operators) => - operators.eq(fields.id, parent.postId), - }), - ]); - - if (currentUser === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - // Post id existing but the associated post not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. - if (existingPost === undefined) { - ctx.log.error( - "Postgres select operation returned an empty array for a comment's post id that isn't null.", - ); - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - }); - } - - const currentUserOrganizationMembership = - existingPost.organization.organizationMembershipsWhereOrganization[0]; - - if ( - currentUser.role !== "administrator" && - (currentUserOrganizationMembership === undefined || - currentUserOrganizationMembership.role !== "administrator") - ) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthorized_action", - }, - }); - } - - if (parent.updaterId === null) { - return null; - } - - if (parent.updaterId === currentUserId) { - return currentUser; - } - - const updaterId = parent.updaterId; - - const existingUser = await ctx.drizzleClient.query.usersTable.findFirst( - { - where: (fields, operators) => operators.eq(fields.id, updaterId), - }, - ); - - // Updater id existing but the associated user not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. - if (existingUser === undefined) { - ctx.log.error( - "Postgres select operation returned an empty array for a comment's updater id that isn't null.", - ); - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - }); - } - - return existingUser; - }, - type: User, - }), - }), -}); diff --git a/src/graphql/types/Event/createdAt.ts b/src/graphql/types/Event/createdAt.ts index 9d44c96975..18fdf800db 100644 --- a/src/graphql/types/Event/createdAt.ts +++ b/src/graphql/types/Event/createdAt.ts @@ -4,7 +4,7 @@ import { Event } from "./Event"; Event.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the event was first created.", + description: "Date time at the time the event was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Event/creator.ts b/src/graphql/types/Event/creator.ts index 0a31096e0e..949974f82f 100644 --- a/src/graphql/types/Event/creator.ts +++ b/src/graphql/types/Event/creator.ts @@ -5,7 +5,7 @@ import { Event } from "./Event"; Event.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the event.", + description: "User who created the event.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Event/organization.ts b/src/graphql/types/Event/organization.ts index 617a76aa96..2fc6a09fde 100644 --- a/src/graphql/types/Event/organization.ts +++ b/src/graphql/types/Event/organization.ts @@ -16,7 +16,7 @@ Event.implement({ // Organziation id existing but the associated organization not existing is a business logic error and probably means that the corresponding data in the database is in a corrupted state. It must be investigated and fixed as soon as possible to prevent additional data corruption. if (existingOrganization === undefined) { ctx.log.error( - "Postgres select operation returned an empty array for a event's organization id that isn't null.", + "Postgres select operation returned an empty array for an event's organization id that isn't null.", ); throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Event/updater.ts b/src/graphql/types/Event/updater.ts index bd0c767c0d..0451503320 100644 --- a/src/graphql/types/Event/updater.ts +++ b/src/graphql/types/Event/updater.ts @@ -74,6 +74,7 @@ Event.implement({ ctx.log.error( "Postgres select operation returned an empty array for an event's updater id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/Event/venues.ts b/src/graphql/types/Event/venues.ts index 52a10980bb..dfe46be85c 100644 --- a/src/graphql/types/Event/venues.ts +++ b/src/graphql/types/Event/venues.ts @@ -1,5 +1,5 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt, or } from "drizzle-orm"; -import type { z } from "zod"; +import { z } from "zod"; import { venueBookingsTable, venueBookingsTableInsertSchema, @@ -44,8 +44,12 @@ const cursorSchema = venueBookingsTableInsertSchema venueId: true, }) .extend({ - createdAt: venueBookingsTableInsertSchema.shape.createdAt.unwrap(), - }); + createdAt: z.string().datetime(), + }) + .transform((arg) => ({ + createdAt: new Date(arg.createdAt), + venueId: arg.venueId, + })); Event.implement({ fields: (t) => ({ @@ -54,14 +58,6 @@ Event.implement({ description: "GraphQL connection to traverse through the venues that are booked for the event.", resolve: async (parent, args, ctx) => { - if (!ctx.currentClient.isAuthenticated) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - const { data: parsedArgs, error, @@ -80,56 +76,15 @@ Event.implement({ }); } - const currentUserId = ctx.currentClient.user.id; - - const currentUser = - await ctx.drizzleClient.query.usersTable.findFirst({ - with: { - organizationMembershipsWhereMember: { - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.organizationId, parent.organizationId), - }, - }, - where: (fields, operators) => - operators.eq(fields.id, currentUserId), - }); - - if (currentUser === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - }); - } - - const currentUserOrganizationMembership = - currentUser.organizationMembershipsWhereMember[0]; - - if ( - currentUser.role !== "administrator" && - currentUserOrganizationMembership === undefined - ) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthorized_action", - }, - }); - } - const { cursor, isInversed, limit } = parsedArgs; const orderBy = isInversed ? [ asc(venueBookingsTable.createdAt), - asc(venueBookingsTable.eventId), asc(venueBookingsTable.venueId), ] : [ desc(venueBookingsTable.createdAt), - desc(venueBookingsTable.eventId), desc(venueBookingsTable.venueId), ]; @@ -201,7 +156,11 @@ Event.implement({ orderBy, where, with: { - venue: true, + venue: { + with: { + venueAttachmentsWhereVenue: true, + }, + }, }, }); @@ -226,7 +185,10 @@ Event.implement({ venueId: booking.venueId, }), ).toString("base64url"), - createNode: (booking) => booking.venue, + createNode: ({ venue: { venueAttachmentsWhereVenue, ...venue } }) => + Object.assign(venue, { + attachments: venueAttachmentsWhereVenue, + }), parsedArgs, rawNodes: venueBookings, }); diff --git a/src/graphql/types/Fund/campaigns.ts b/src/graphql/types/Fund/campaigns.ts index 8208474813..185337de1a 100644 --- a/src/graphql/types/Fund/campaigns.ts +++ b/src/graphql/types/Fund/campaigns.ts @@ -75,6 +75,7 @@ Fund.implement({ : [asc(fundCampaignsTable.name)]; let where: SQL | undefined; + if (isInversed) { if (cursor !== undefined) { where = and( diff --git a/src/graphql/types/Fund/createdAt.ts b/src/graphql/types/Fund/createdAt.ts index ce084f77e0..63f5dfad17 100644 --- a/src/graphql/types/Fund/createdAt.ts +++ b/src/graphql/types/Fund/createdAt.ts @@ -4,7 +4,7 @@ import { Fund } from "./Fund"; Fund.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the fund was first created.", + description: "Date time at the time the fund was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Fund/creator.ts b/src/graphql/types/Fund/creator.ts index d014eacf74..187b165c4c 100644 --- a/src/graphql/types/Fund/creator.ts +++ b/src/graphql/types/Fund/creator.ts @@ -5,7 +5,7 @@ import { Fund } from "./Fund"; Fund.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the fund.", + description: "User who created the fund.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -74,6 +74,7 @@ Fund.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund's creator id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/Fund/updater.ts b/src/graphql/types/Fund/updater.ts index 7bab9fa33d..bb870ac683 100644 --- a/src/graphql/types/Fund/updater.ts +++ b/src/graphql/types/Fund/updater.ts @@ -74,6 +74,7 @@ Fund.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund's updater id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/FundCampaign/createdAt.ts b/src/graphql/types/FundCampaign/createdAt.ts index 9fcfd399c1..e76671c595 100644 --- a/src/graphql/types/FundCampaign/createdAt.ts +++ b/src/graphql/types/FundCampaign/createdAt.ts @@ -4,7 +4,7 @@ import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the fund campaign was first created.", + description: "Date time at the time the fund campaign was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -63,6 +63,7 @@ FundCampaign.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/FundCampaign/creator.ts b/src/graphql/types/FundCampaign/creator.ts index c0b5fb76e2..f293214271 100644 --- a/src/graphql/types/FundCampaign/creator.ts +++ b/src/graphql/types/FundCampaign/creator.ts @@ -5,7 +5,7 @@ import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the fund campaign.", + description: "User who created the fund campaign.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -60,6 +60,7 @@ FundCampaign.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", @@ -103,6 +104,7 @@ FundCampaign.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's creator id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/FundCampaign/pledgedAmount.ts b/src/graphql/types/FundCampaign/pledgedAmount.ts index 9045c8a16c..557ba5dbdd 100644 --- a/src/graphql/types/FundCampaign/pledgedAmount.ts +++ b/src/graphql/types/FundCampaign/pledgedAmount.ts @@ -1,6 +1,5 @@ import { eq, sum } from "drizzle-orm"; import { fundCampaignPledgesTable } from "~/src/drizzle/tables/fundCampaignPledges"; -import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { FundCampaign } from "./FundCampaign"; FundCampaign.implement({ @@ -15,19 +14,6 @@ FundCampaign.implement({ .from(fundCampaignPledgesTable) .where(eq(fundCampaignPledgesTable.campaignId, parent.id)); - // Selected postgres aggregate not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. - if (fundCampaignPledgedAmount === undefined) { - ctx.log.error( - "Postgres aggregate select operation unexpectedly returned an empty array instead of throwing an error.", - ); - - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - }); - } - if (fundCampaignPledgedAmount.amount === null) { return 0n; } diff --git a/src/graphql/types/FundCampaign/updatedAt.ts b/src/graphql/types/FundCampaign/updatedAt.ts index 91a929547d..e50e5c4706 100644 --- a/src/graphql/types/FundCampaign/updatedAt.ts +++ b/src/graphql/types/FundCampaign/updatedAt.ts @@ -63,6 +63,7 @@ FundCampaign.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/FundCampaign/updater.ts b/src/graphql/types/FundCampaign/updater.ts index c74cd7f3c5..c7aea0a38b 100644 --- a/src/graphql/types/FundCampaign/updater.ts +++ b/src/graphql/types/FundCampaign/updater.ts @@ -60,6 +60,7 @@ FundCampaign.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's fund id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", @@ -103,6 +104,7 @@ FundCampaign.implement({ ctx.log.error( "Postgres select operation returned an empty array for a fund campaign's updater id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/Mutation/createChatMessage.ts b/src/graphql/types/Mutation/createChatMessage.ts index 5f0168b5fa..ca1e26bafc 100644 --- a/src/graphql/types/Mutation/createChatMessage.ts +++ b/src/graphql/types/Mutation/createChatMessage.ts @@ -111,8 +111,8 @@ builder.mutationField("createChatMessage", (t) => }); } - if (parsedArgs.input.parentChatMessageId !== undefined) { - const parentChatMessageId = parsedArgs.input.parentChatMessageId; + if (parsedArgs.input.parentMessageId !== undefined) { + const parentMessageId = parsedArgs.input.parentMessageId; const existingChatMessage = await ctx.drizzleClient.query.chatMessagesTable.findFirst({ @@ -122,7 +122,7 @@ builder.mutationField("createChatMessage", (t) => where: (fields, operators) => operators.and( operators.eq(fields.chatId, parsedArgs.input.chatId), - operators.eq(fields.id, parentChatMessageId), + operators.eq(fields.id, parentMessageId), ), }); @@ -132,7 +132,7 @@ builder.mutationField("createChatMessage", (t) => code: "arguments_associated_resources_not_found", issues: [ { - argumentPath: ["input", "parentChatMessageId"], + argumentPath: ["input", "parentMessageId"], }, ], }, @@ -169,7 +169,7 @@ builder.mutationField("createChatMessage", (t) => body: parsedArgs.input.body, chatId: parsedArgs.input.chatId, creatorId: currentUserId, - parentChatMessageId: parsedArgs.input.parentChatMessageId, + parentMessageId: parsedArgs.input.parentMessageId, }) .returning(); diff --git a/src/graphql/types/Mutation/createVenueBooking.ts b/src/graphql/types/Mutation/createVenueBooking.ts index 980030930b..4a3153df4f 100644 --- a/src/graphql/types/Mutation/createVenueBooking.ts +++ b/src/graphql/types/Mutation/createVenueBooking.ts @@ -83,6 +83,7 @@ builder.mutationField("createVenueBooking", (t) => }, }, }, + venueAttachmentsWhereVenue: true, venueBookingsWhereVenue: { columns: { creatorId: true, @@ -210,7 +211,9 @@ builder.mutationField("createVenueBooking", (t) => }); } - return existingVenue; + return Object.assign(existingVenue, { + attachments: existingVenue.venueAttachmentsWhereVenue, + }); }, type: Venue, }), diff --git a/src/graphql/types/Mutation/deleteVenueBooking.ts b/src/graphql/types/Mutation/deleteVenueBooking.ts index 2372e2366c..021c06c6b7 100644 --- a/src/graphql/types/Mutation/deleteVenueBooking.ts +++ b/src/graphql/types/Mutation/deleteVenueBooking.ts @@ -84,6 +84,7 @@ builder.mutationField("deleteVenueBooking", (t) => }, }, }, + venueAttachmentsWhereVenue: true, venueBookingsWhereVenue: { columns: { creatorId: true, @@ -205,7 +206,9 @@ builder.mutationField("deleteVenueBooking", (t) => }); } - return existingVenue; + return Object.assign(existingVenue, { + attachments: existingVenue.venueAttachmentsWhereVenue, + }); }, type: Venue, }), diff --git a/src/graphql/types/Mutation/signUp.ts b/src/graphql/types/Mutation/signUp.ts index d3f4d0323c..7ca56430f6 100755 --- a/src/graphql/types/Mutation/signUp.ts +++ b/src/graphql/types/Mutation/signUp.ts @@ -14,6 +14,7 @@ import { import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { isNotNullish } from "~/src/utilities/isNotNullish"; +import type { CurrentClient } from "../../context"; const mutationSignUpArgumentsSchema = z.object({ input: mutationSignUpInputSchema.transform(async (arg, ctx) => { @@ -171,6 +172,13 @@ builder.mutationField("signUp", (t) => ); } + // The following code is necessary for continuing the expected graph traversal for an authenticated client because of absence of an authentication context for clients that triggered this operation. This should be removed when authentication flows are seperated from the graphql implementation. + + ctx.currentClient.isAuthenticated = true; + ctx.currentClient.user = { + id: createdUser.id, + } as CurrentClient["user"]; + return { authenticationToken: ctx.jwt.sign({ user: { diff --git a/src/graphql/types/Mutation/updateComment.ts b/src/graphql/types/Mutation/updateComment.ts index 76c5e93b4d..613c540fe3 100644 --- a/src/graphql/types/Mutation/updateComment.ts +++ b/src/graphql/types/Mutation/updateComment.ts @@ -137,7 +137,6 @@ builder.mutationField("updateComment", (t) => .update(commentsTable) .set({ body: parsedArgs.input.body, - updaterId: currentUserId, }) .where(eq(commentsTable.id, parsedArgs.input.id)) .returning(); diff --git a/src/graphql/types/Organization/advertisements.ts b/src/graphql/types/Organization/advertisements.ts index 12c7ab9b1a..42ad775f62 100644 --- a/src/graphql/types/Organization/advertisements.ts +++ b/src/graphql/types/Organization/advertisements.ts @@ -125,6 +125,7 @@ Organization.implement({ : [asc(advertisementsTable.name)]; let where: SQL | undefined; + if (isInversed) { if (cursor !== undefined) { where = and( diff --git a/src/graphql/types/Organization/chats.ts b/src/graphql/types/Organization/chats.ts index 29993121ae..b4eec9669a 100644 --- a/src/graphql/types/Organization/chats.ts +++ b/src/graphql/types/Organization/chats.ts @@ -51,6 +51,14 @@ Organization.implement({ description: "GraphQL connection to traverse through the chats belonging to the organization.", resolve: async (parent, args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + const { data: parsedArgs, error, @@ -69,6 +77,48 @@ Organization.implement({ }); } + const currentUserId = ctx.currentClient.user.id; + + const currentUser = + await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + with: { + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.id), + }, + }, + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + currentUserOrganizationMembership === undefined + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + const { cursor, isInversed, limit } = parsedArgs; const orderBy = isInversed diff --git a/src/graphql/types/Organization/creator.ts b/src/graphql/types/Organization/creator.ts index 852a2600f8..6304d77517 100755 --- a/src/graphql/types/Organization/creator.ts +++ b/src/graphql/types/Organization/creator.ts @@ -5,7 +5,7 @@ import { Organization } from "./Organization"; Organization.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the organization.", + description: "User who created the organization.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -15,6 +15,47 @@ Organization.implement({ }); } + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + with: { + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.id), + }, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + (currentUserOrganizationMembership === undefined || + currentUserOrganizationMembership.role !== "administrator") + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + if (parent.creatorId === null) { return null; } @@ -29,8 +70,9 @@ Organization.implement({ // Creator id existing but the associated user not existing is either a business logic error which means that the corresponding data in the database is in a corrupted state or it is a rare race condition. It must be investigated and fixed as soon as possible to prevent further data corruption if the former case is true. if (existingUser === undefined) { ctx.log.warn( - "Postgres select operation returned an empty array for a organization's creator id that isn't null.", + "Postgres select operation returned an empty array for an organization's creator id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/Organization/events.ts b/src/graphql/types/Organization/events.ts index 37b9ec0e2e..682fed1664 100644 --- a/src/graphql/types/Organization/events.ts +++ b/src/graphql/types/Organization/events.ts @@ -1,5 +1,5 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt, or } from "drizzle-orm"; -import type { z } from "zod"; +import { z } from "zod"; import { eventsTable, eventsTableInsertSchema, @@ -39,13 +39,15 @@ const eventsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema }; }); -const cursorSchema = eventsTableInsertSchema - .pick({ - startAt: true, - }) - .extend({ +const cursorSchema = z + .object({ id: eventsTableInsertSchema.shape.id.unwrap(), - }); + startAt: z.string().datetime(), + }) + .transform((arg) => ({ + id: arg.id, + startAt: new Date(arg.startAt), + })); Organization.implement({ fields: (t) => ({ @@ -212,7 +214,8 @@ Organization.implement({ createCursor: (event) => Buffer.from( JSON.stringify({ - name: event.name, + id: event.id, + startAt: event.startAt.toISOString(), }), ).toString("base64url"), createNode: ({ eventAttachmentsWhereEvent, ...event }) => diff --git a/src/graphql/types/Organization/funds.ts b/src/graphql/types/Organization/funds.ts index ae65ff5178..e3a2a30698 100644 --- a/src/graphql/types/Organization/funds.ts +++ b/src/graphql/types/Organization/funds.ts @@ -47,6 +47,14 @@ Organization.implement({ description: "GraphQL connection to traverse through the funds belonging to the organization.", resolve: async (parent, args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + const { data: parsedArgs, error, @@ -65,6 +73,49 @@ Organization.implement({ }); } + const currentUserId = ctx.currentClient.user.id; + + const currentUser = + await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + with: { + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.id), + }, + }, + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + (currentUserOrganizationMembership === undefined || + currentUserOrganizationMembership.role !== "administrator") + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + const { cursor, isInversed, limit } = parsedArgs; const orderBy = isInversed diff --git a/src/graphql/types/Organization/members.ts b/src/graphql/types/Organization/members.ts index 5ec801d959..e483c76c39 100644 --- a/src/graphql/types/Organization/members.ts +++ b/src/graphql/types/Organization/members.ts @@ -58,6 +58,14 @@ Organization.implement({ description: "GraphQL connection to traverse through the users that are members of the organization.", resolve: async (parent, args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + const { data: parsedArgs, error, @@ -76,21 +84,62 @@ Organization.implement({ }); } + const currentUserId = ctx.currentClient.user.id; + + const currentUser = + await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + with: { + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.id), + }, + }, + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + currentUserOrganizationMembership === undefined + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + const { cursor, isInversed, limit } = parsedArgs; const orderBy = isInversed ? [ asc(organizationMembershipsTable.createdAt), asc(organizationMembershipsTable.memberId), - asc(organizationMembershipsTable.organizationId), ] : [ desc(organizationMembershipsTable.createdAt), desc(organizationMembershipsTable.memberId), - desc(organizationMembershipsTable.organizationId), ]; let where: SQL | undefined; + if (isInversed) { if (cursor !== undefined) { where = and( @@ -100,6 +149,10 @@ Organization.implement({ .from(organizationMembershipsTable) .where( and( + eq( + organizationMembershipsTable.createdAt, + cursor.createdAt, + ), eq( organizationMembershipsTable.memberId, cursor.memberId, @@ -138,6 +191,10 @@ Organization.implement({ .from(organizationMembershipsTable) .where( and( + eq( + organizationMembershipsTable.createdAt, + cursor.createdAt, + ), eq( organizationMembershipsTable.memberId, cursor.memberId, @@ -203,7 +260,7 @@ Organization.implement({ createCursor: (organizationMembership) => Buffer.from( JSON.stringify({ - createdAt: organizationMembership.createdAt, + createdAt: organizationMembership.createdAt.toISOString(), memberId: organizationMembership.memberId, }), ).toString("base64url"), diff --git a/src/graphql/types/Organization/pinnedPosts.ts b/src/graphql/types/Organization/pinnedPosts.ts index 6d9e8f6042..197442f3b8 100644 --- a/src/graphql/types/Organization/pinnedPosts.ts +++ b/src/graphql/types/Organization/pinnedPosts.ts @@ -48,10 +48,15 @@ const pinnedPostsArgumentsSchema = defaultGraphQLConnectionArgumentsSchema }; }); -const cursorSchema = z.object({ - id: postsTableInsertSchema.shape.id.unwrap(), - pinnedAt: postsTableInsertSchema.shape.pinnedAt.unwrap().unwrap(), -}); +const cursorSchema = z + .object({ + id: postsTableInsertSchema.shape.id.unwrap(), + pinnedAt: z.string().datetime(), + }) + .transform((arg) => ({ + id: arg.id, + pinnedAt: new Date(arg.pinnedAt), + })); Organization.implement({ fields: (t) => ({ @@ -228,7 +233,8 @@ Organization.implement({ Buffer.from( JSON.stringify({ id: post.id, - pinnedAt: post.pinnedAt, + // `pinnedAt` field below cannot have `null` as the value because of the sql query logic. The optional chaining operator is just to prevent type errors. + pinnedAt: post.pinnedAt?.toISOString(), }), ).toString("base64url"), createNode: ({ postAttachmentsWherePost, ...post }) => diff --git a/src/graphql/types/Organization/pinnedPostsCount.ts b/src/graphql/types/Organization/pinnedPostsCount.ts index aa0d6a16b2..febf5851e3 100644 --- a/src/graphql/types/Organization/pinnedPostsCount.ts +++ b/src/graphql/types/Organization/pinnedPostsCount.ts @@ -1,5 +1,6 @@ import { and, count, eq, ne, sql } from "drizzle-orm"; import { postsTable } from "~/src/drizzle/tables/posts"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Organization } from "./Organization"; Organization.implement({ @@ -8,17 +9,67 @@ Organization.implement({ description: "Total number of pinned posts belonging to the organization.", resolve: async (parent, _args, ctx) => { - const [postsCount] = await ctx.drizzleClient - .select({ - count: count(), - }) - .from(postsTable) - .where( - and( - eq(postsTable.organizationId, parent.id), - ne(postsTable.pinnedAt, sql`${null}`), + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const [currentUser, [postsCount]] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + with: { + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.id), + }, + }, + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient + .select({ + count: count(), + }) + .from(postsTable) + .where( + and( + eq(postsTable.organizationId, parent.id), + ne(postsTable.pinnedAt, sql`${null}`), + ), ), - ); + ]); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + currentUserOrganizationMembership === undefined + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } if (postsCount === undefined) { return 0; diff --git a/src/graphql/types/Organization/postsCount.ts b/src/graphql/types/Organization/postsCount.ts index 2a6f35ec2b..1dff7537c3 100644 --- a/src/graphql/types/Organization/postsCount.ts +++ b/src/graphql/types/Organization/postsCount.ts @@ -1,5 +1,6 @@ import { count, eq } from "drizzle-orm"; import { postsTable } from "~/src/drizzle/tables/posts"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; import { Organization } from "./Organization"; Organization.implement({ @@ -7,12 +8,62 @@ Organization.implement({ postsCount: t.field({ description: "Total number of posts belonging to the organization.", resolve: async (parent, _args, ctx) => { - const [postsCount] = await ctx.drizzleClient - .select({ - count: count(), - }) - .from(postsTable) - .where(eq(postsTable.organizationId, parent.id)); + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const [currentUser, [postsCount]] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + with: { + organizationMembershipsWhereMember: { + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.organizationId, parent.id), + }, + }, + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient + .select({ + count: count(), + }) + .from(postsTable) + .where(eq(postsTable.organizationId, parent.id)), + ]); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserOrganizationMembership = + currentUser.organizationMembershipsWhereMember[0]; + + if ( + currentUser.role !== "administrator" && + currentUserOrganizationMembership === undefined + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } if (postsCount === undefined) { return 0; diff --git a/src/graphql/types/Organization/tagFolders.ts b/src/graphql/types/Organization/tagFolders.ts index 9913cf5f17..d02c20f9ed 100644 --- a/src/graphql/types/Organization/tagFolders.ts +++ b/src/graphql/types/Organization/tagFolders.ts @@ -124,7 +124,8 @@ Organization.implement({ if ( currentUser.role !== "administrator" && - currentUserOrganizationMembership === undefined + (currentUserOrganizationMembership === undefined || + currentUserOrganizationMembership.role !== "administrator") ) { throw new TalawaGraphQLError({ extensions: { @@ -231,6 +232,7 @@ Organization.implement({ createCursor: (tag) => Buffer.from( JSON.stringify({ + id: tag.id, name: tag.name, }), ).toString("base64url"), diff --git a/src/graphql/types/Organization/tags.ts b/src/graphql/types/Organization/tags.ts index 1d6c774b57..dc16662aa4 100644 --- a/src/graphql/types/Organization/tags.ts +++ b/src/graphql/types/Organization/tags.ts @@ -106,7 +106,8 @@ Organization.implement({ if ( currentUser.role !== "administrator" && - currentUserOrganizationMembership === undefined + (currentUserOrganizationMembership === undefined || + currentUserOrganizationMembership.role !== "administrator") ) { throw new TalawaGraphQLError({ extensions: { diff --git a/src/graphql/types/Organization/venues.ts b/src/graphql/types/Organization/venues.ts index 56e7aa6ef2..095cfe4656 100644 --- a/src/graphql/types/Organization/venues.ts +++ b/src/graphql/types/Organization/venues.ts @@ -109,7 +109,8 @@ Organization.implement({ if ( currentUser.role !== "administrator" && - currentUserOrganizationMembership === undefined + (currentUserOrganizationMembership === undefined || + currentUserOrganizationMembership.role !== "administrator") ) { throw new TalawaGraphQLError({ extensions: { diff --git a/src/graphql/types/Post/creator.ts b/src/graphql/types/Post/creator.ts index cf58741d8e..307c751afe 100644 --- a/src/graphql/types/Post/creator.ts +++ b/src/graphql/types/Post/creator.ts @@ -5,7 +5,7 @@ import { Post } from "./Post"; Post.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the post.", + description: "User who created the post.", resolve: async (parent, _args, ctx) => { if (parent.creatorId === null) { return null; diff --git a/src/graphql/types/Post/downVoters.ts b/src/graphql/types/Post/downVoters.ts index 328f2c9c2c..436dffcbcc 100644 --- a/src/graphql/types/Post/downVoters.ts +++ b/src/graphql/types/Post/downVoters.ts @@ -51,10 +51,15 @@ const downVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema }; }); -const cursorSchema = z.object({ - createdAt: postVotesTableInsertSchema.shape.createdAt.unwrap(), - creatorId: postVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), -}); +const cursorSchema = z + .object({ + createdAt: z.string().datetime(), + creatorId: postVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), + }) + .transform((arg) => ({ + createdAt: new Date(arg.createdAt), + creatorId: arg.creatorId, + })); Post.implement({ fields: (t) => ({ @@ -98,6 +103,7 @@ Post.implement({ .from(postVotesTable) .where( and( + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.createdAt, cursor.createdAt), eq(postVotesTable.creatorId, cursor.creatorId), eq(postVotesTable.postId, parent.id), @@ -105,6 +111,7 @@ Post.implement({ ), ), ), + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.postId, parent.id), eq(postVotesTable.type, "down_vote"), or( @@ -131,6 +138,7 @@ Post.implement({ .from(postVotesTable) .where( and( + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.createdAt, cursor.createdAt), eq(postVotesTable.creatorId, cursor.creatorId), eq(postVotesTable.postId, parent.id), @@ -138,6 +146,7 @@ Post.implement({ ), ), ), + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.postId, parent.id), eq(postVotesTable.type, "down_vote"), or( @@ -188,12 +197,13 @@ Post.implement({ createCursor: (vote) => Buffer.from( JSON.stringify({ - createdAt: vote.createdAt, + createdAt: vote.createdAt.toISOString(), creatorId: vote.creatorId, }), ).toString("base64url"), createNode: (vote) => vote.creator, parsedArgs, + // None of the post votes below contain a `creator` field with `null` as the value because of the sql query logic. This filter operation is here just to prevent type errors. rawNodes: postVotes.filter( ( vote, diff --git a/src/graphql/types/Post/upVoters.ts b/src/graphql/types/Post/upVoters.ts index a922dc37cf..c92bcb64f3 100644 --- a/src/graphql/types/Post/upVoters.ts +++ b/src/graphql/types/Post/upVoters.ts @@ -51,10 +51,15 @@ const upVotersArgumentsSchema = defaultGraphQLConnectionArgumentsSchema }; }); -const cursorSchema = z.object({ - createdAt: postVotesTableInsertSchema.shape.createdAt.unwrap(), - creatorId: postVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), -}); +const cursorSchema = z + .object({ + createdAt: z.string().datetime(), + creatorId: postVotesTableInsertSchema.shape.creatorId.unwrap().unwrap(), + }) + .transform((arg) => ({ + createdAt: new Date(arg.createdAt), + creatorId: arg.creatorId, + })); Post.implement({ fields: (t) => ({ @@ -98,6 +103,7 @@ Post.implement({ .from(postVotesTable) .where( and( + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.createdAt, cursor.createdAt), eq(postVotesTable.creatorId, cursor.creatorId), eq(postVotesTable.postId, parent.id), @@ -105,6 +111,7 @@ Post.implement({ ), ), ), + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.postId, parent.id), eq(postVotesTable.type, "up_vote"), or( @@ -131,6 +138,7 @@ Post.implement({ .from(postVotesTable) .where( and( + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.createdAt, cursor.createdAt), eq(postVotesTable.creatorId, cursor.creatorId), eq(postVotesTable.postId, parent.id), @@ -138,6 +146,7 @@ Post.implement({ ), ), ), + ne(postVotesTable.creatorId, sql`${null}`), eq(postVotesTable.postId, parent.id), eq(postVotesTable.type, "up_vote"), or( @@ -188,12 +197,13 @@ Post.implement({ createCursor: (vote) => Buffer.from( JSON.stringify({ - createdAt: vote.createdAt, + createdAt: vote.createdAt.toISOString(), creatorId: vote.creatorId, }), ).toString("base64url"), createNode: (vote) => vote.creator, parsedArgs, + // None of the post votes below contain a `creator` field with `null` as the value because of the sql query logic. This filter operation is here just to prevent type errors. rawNodes: postVotes.filter( ( vote, diff --git a/src/graphql/types/Query/signIn.ts b/src/graphql/types/Query/signIn.ts index f488ad1f9c..eb91282c45 100755 --- a/src/graphql/types/Query/signIn.ts +++ b/src/graphql/types/Query/signIn.ts @@ -7,6 +7,7 @@ import { } from "~/src/graphql/inputs/QuerySignInInput"; import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import type { CurrentClient } from "../../context"; const querySignInArgumentsSchema = z.object({ input: querySignInInputSchema, @@ -83,6 +84,15 @@ builder.queryField("signIn", (t) => }); } + // The following code is necessary for continuing the expected graph traversal for an authenticated client because of absence of an authentication context for clients that triggered this operation. This should be removed when authentication flows are seperated from the graphql implementation. + + // @ts-expect-error + ctx.currentClient.isAuthenticated = true; + // @ts-expect-error + ctx.currentClient.user = { + id: existingUser.id, + } as CurrentClient["user"]; + return { authenticationToken: ctx.jwt.sign({ user: { diff --git a/src/graphql/types/Tag/assignees.ts b/src/graphql/types/Tag/assignees.ts new file mode 100644 index 0000000000..715f130833 --- /dev/null +++ b/src/graphql/types/Tag/assignees.ts @@ -0,0 +1,199 @@ +import { type SQL, and, asc, desc, eq, exists, gt, lt, or } from "drizzle-orm"; +import { z } from "zod"; +import { + tagAssignmentsTable, + tagAssignmentsTableInsertSchema, +} from "~/src/drizzle/tables/tagAssignments"; +import { User } from "~/src/graphql/types/User/User"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { + defaultGraphQLConnectionArgumentsSchema, + transformDefaultGraphQLConnectionArguments, + transformToDefaultGraphQLConnection, +} from "~/src/utilities/defaultGraphQLConnection"; +import { Tag } from "./Tag"; + +const assigneesArgumentsSchema = defaultGraphQLConnectionArgumentsSchema + .transform(transformDefaultGraphQLConnectionArguments) + .transform((arg, ctx) => { + let cursor: z.infer<typeof cursorSchema> | undefined = undefined; + + try { + if (arg.cursor !== undefined) { + cursor = cursorSchema.parse( + JSON.parse(Buffer.from(arg.cursor, "base64url").toString("utf-8")), + ); + } + } catch (error) { + ctx.addIssue({ + code: "custom", + message: "Not a valid cursor.", + path: [arg.isInversed ? "before" : "after"], + }); + } + + return { + cursor, + isInversed: arg.isInversed, + limit: arg.limit, + }; + }); + +const cursorSchema = tagAssignmentsTableInsertSchema + .pick({ + assigneeId: true, + }) + .extend({ + createdAt: z.string().datetime(), + }) + .transform((arg) => ({ + assigneeId: arg.assigneeId, + createdAt: new Date(arg.createdAt), + })); + +Tag.implement({ + fields: (t) => ({ + assignees: t.connection( + { + description: + "GraphQL connection to traverse through the users that are assignees of the tag.", + resolve: async (parent, args, ctx) => { + const { + data: parsedArgs, + error, + success, + } = assigneesArgumentsSchema.safeParse(args); + + if (!success) { + throw new TalawaGraphQLError({ + extensions: { + code: "invalid_arguments", + issues: error.issues.map((issue) => ({ + argumentPath: issue.path, + message: issue.message, + })), + }, + }); + } + + const { cursor, isInversed, limit } = parsedArgs; + + const orderBy = isInversed + ? [ + asc(tagAssignmentsTable.createdAt), + asc(tagAssignmentsTable.assigneeId), + ] + : [ + desc(tagAssignmentsTable.createdAt), + desc(tagAssignmentsTable.assigneeId), + ]; + + let where: SQL | undefined; + + if (isInversed) { + if (cursor !== undefined) { + where = and( + exists( + ctx.drizzleClient + .select() + .from(tagAssignmentsTable) + .where( + and( + eq(tagAssignmentsTable.assigneeId, cursor.assigneeId), + eq(tagAssignmentsTable.createdAt, cursor.createdAt), + eq(tagAssignmentsTable.tagId, parent.id), + ), + ), + ), + eq(tagAssignmentsTable.tagId, parent.id), + or( + and( + eq(tagAssignmentsTable.createdAt, cursor.createdAt), + gt(tagAssignmentsTable.assigneeId, cursor.assigneeId), + ), + gt(tagAssignmentsTable.createdAt, cursor.createdAt), + ), + ); + } else { + where = eq(tagAssignmentsTable.tagId, parent.id); + } + } else { + if (cursor !== undefined) { + where = and( + exists( + ctx.drizzleClient + .select() + .from(tagAssignmentsTable) + .where( + and( + eq(tagAssignmentsTable.assigneeId, cursor.assigneeId), + eq(tagAssignmentsTable.createdAt, cursor.createdAt), + eq(tagAssignmentsTable.tagId, parent.id), + ), + ), + ), + eq(tagAssignmentsTable.tagId, parent.id), + or( + and( + eq(tagAssignmentsTable.createdAt, cursor.createdAt), + lt(tagAssignmentsTable.assigneeId, cursor.assigneeId), + ), + lt(tagAssignmentsTable.createdAt, cursor.createdAt), + ), + ); + } else { + where = eq(tagAssignmentsTable.tagId, parent.id); + } + } + + const tagAssignments = + await ctx.drizzleClient.query.tagAssignmentsTable.findMany({ + columns: { + assigneeId: true, + createdAt: true, + }, + limit, + orderBy, + with: { + assignee: true, + }, + where, + }); + + if (cursor !== undefined && tagAssignments.length === 0) { + throw new TalawaGraphQLError({ + extensions: { + code: "arguments_associated_resources_not_found", + issues: [ + { + argumentPath: [isInversed ? "before" : "after"], + }, + ], + }, + }); + } + + return transformToDefaultGraphQLConnection({ + createCursor: (assignment) => + Buffer.from( + JSON.stringify({ + assigneeId: assignment.assigneeId, + createdAt: assignment.createdAt.toISOString(), + }), + ).toString("base64url"), + createNode: (assignment) => assignment.assignee, + parsedArgs, + rawNodes: tagAssignments, + }); + }, + type: User, + }, + { + description: "", + }, + { + description: "", + }, + ), + }), +}); diff --git a/src/graphql/types/Tag/createdAt.ts b/src/graphql/types/Tag/createdAt.ts index 76f8f3706d..695742b95f 100644 --- a/src/graphql/types/Tag/createdAt.ts +++ b/src/graphql/types/Tag/createdAt.ts @@ -4,7 +4,7 @@ import { Tag } from "./Tag"; Tag.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the tag was first created.", + description: "Date time at the time the tag was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Tag/creator.ts b/src/graphql/types/Tag/creator.ts index bd42052614..ff1d4eab13 100644 --- a/src/graphql/types/Tag/creator.ts +++ b/src/graphql/types/Tag/creator.ts @@ -5,7 +5,7 @@ import { Tag } from "./Tag"; Tag.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the tag.", + description: "User who created the tag.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Tag/index.ts b/src/graphql/types/Tag/index.ts index 4fef149155..688b741a02 100644 --- a/src/graphql/types/Tag/index.ts +++ b/src/graphql/types/Tag/index.ts @@ -1,4 +1,5 @@ import "./Tag"; +import "./assignees"; import "./createdAt"; import "./creator"; import "./folder"; diff --git a/src/graphql/types/TagFolder/creator.ts b/src/graphql/types/TagFolder/creator.ts index 65de6cd0d6..08c477af58 100644 --- a/src/graphql/types/TagFolder/creator.ts +++ b/src/graphql/types/TagFolder/creator.ts @@ -5,7 +5,7 @@ import { TagFolder } from "./TagFolder"; TagFolder.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the tag folder.", + description: "User who created the tag folder.", resolve: async (parent, _args, ctx) => { if (parent.creatorId === null) { return null; diff --git a/src/graphql/types/User/User.ts b/src/graphql/types/User/User.ts index 9794fb8456..89472ad0f4 100644 --- a/src/graphql/types/User/User.ts +++ b/src/graphql/types/User/User.ts @@ -1,10 +1,6 @@ import type { usersTable } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; -import { Iso3166Alpha2CountryCode } from "~/src/graphql/enums/Iso3166Alpha2CountryCode"; -import { UserEducationGrade } from "~/src/graphql/enums/UserEducationGrade"; -import { UserEmploymentStatus } from "~/src/graphql/enums/UserEmploymentStatus"; -import { UserMaritalStatus } from "~/src/graphql/enums/UserMaritalStatus"; -import { UserNatalSex } from "~/src/graphql/enums/UserNatalSex"; + import { UserRole } from "~/src/graphql/enums/UserRole"; export type User = typeof usersTable.$inferSelect; @@ -14,23 +10,9 @@ export const User = builder.objectRef<User>("User"); User.implement({ description: "Users are the recognized identities of clients using talawa.", fields: (t) => ({ - address: t.exposeString("address", { - description: "Address of the user.", - }), avatarMimeType: t.exposeString("avatarMimeType", { description: "Mime type of the avatar of the user.", }), - birthDate: t.expose("birthDate", { - description: "Date of birth of the user.", - type: "Date", - }), - city: t.exposeString("city", { - description: "Name of the city where the user resides in.", - }), - countryCode: t.expose("countryCode", { - description: "Country code of the country the user is a citizen of.", - type: Iso3166Alpha2CountryCode, - }), createdAt: t.expose("createdAt", { description: "Date time at the time the user was created.", type: "DateTime", @@ -38,61 +20,16 @@ User.implement({ description: t.exposeString("description", { description: "Custom information about the user.", }), - educationGrade: t.expose("educationGrade", { - description: "Primary education grade of the user.", - type: UserEducationGrade, - }), - emailAddress: t.expose("emailAddress", { - description: "Email address of the user.", - type: "EmailAddress", - }), - employmentStatus: t.expose("employmentStatus", { - description: "Employment status of the user.", - type: UserEmploymentStatus, - }), - homePhoneNumber: t.expose("homePhoneNumber", { - description: - "The phone number to use to communicate with the user at their home.", - type: "PhoneNumber", - }), id: t.exposeID("id", { description: "Global identifier of the user.", nullable: false, }), - isEmailAddressVerified: t.exposeBoolean("isEmailAddressVerified", { - description: - "Boolean to tell whether the user has verified their email address.", - }), - maritalStatus: t.expose("maritalStatus", { - description: "Marital status of the user.", - type: UserMaritalStatus, - }), - mobilePhoneNumber: t.expose("mobilePhoneNumber", { - description: - "The phone number to use to communicate with the user on their mobile phone.", - type: "PhoneNumber", - }), name: t.exposeString("name", { description: "Name of the user.", }), - natalSex: t.expose("natalSex", { - description: "The sex assigned to the user at their birth.", - type: UserNatalSex, - }), - postalCode: t.exposeString("postalCode", { - description: "Postal code of the user.", - }), role: t.expose("role", { description: "Role assigned to the user in the application.", type: UserRole, }), - state: t.exposeString("state", { - description: "Name of the state the user resides in.", - }), - workPhoneNumber: t.expose("workPhoneNumber", { - description: - "The phone number to use to communicate with the user while they're at work.", - type: "PhoneNumber", - }), }), }); diff --git a/src/graphql/types/User/address.ts b/src/graphql/types/User/address.ts new file mode 100644 index 0000000000..5fa63a4d25 --- /dev/null +++ b/src/graphql/types/User/address.ts @@ -0,0 +1,50 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + address: t.field({ + description: "Address of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.address; + }, + type: "String", + }), + }), +}); diff --git a/src/graphql/types/User/birthDate.ts b/src/graphql/types/User/birthDate.ts new file mode 100644 index 0000000000..b53642f8f8 --- /dev/null +++ b/src/graphql/types/User/birthDate.ts @@ -0,0 +1,50 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + birthDate: t.field({ + description: "Date of birth of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.birthDate; + }, + type: "Date", + }), + }), +}); diff --git a/src/graphql/types/User/city.ts b/src/graphql/types/User/city.ts new file mode 100644 index 0000000000..b88bba1fcf --- /dev/null +++ b/src/graphql/types/User/city.ts @@ -0,0 +1,53 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + city: t.field({ + description: "Name of the city where the user resides in.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + console.log("============================="); + console.log(currentUser.role); + console.log("============================="); + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.city; + }, + type: "String", + }), + }), +}); diff --git a/src/graphql/types/User/countryCode.ts b/src/graphql/types/User/countryCode.ts new file mode 100644 index 0000000000..16cb106ae3 --- /dev/null +++ b/src/graphql/types/User/countryCode.ts @@ -0,0 +1,51 @@ +import { Iso3166Alpha2CountryCode } from "~/src/graphql/enums/Iso3166Alpha2CountryCode"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + countryCode: t.field({ + description: "Country code of the country the user is a citizen of.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.countryCode; + }, + type: Iso3166Alpha2CountryCode, + }), + }), +}); diff --git a/src/graphql/types/User/creator.ts b/src/graphql/types/User/creator.ts index 88f04adfcf..9feb23ef8a 100755 --- a/src/graphql/types/User/creator.ts +++ b/src/graphql/types/User/creator.ts @@ -4,7 +4,7 @@ import { User } from "./User"; User.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the user.", + description: "User who created the user.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ @@ -60,6 +60,7 @@ User.implement({ ctx.log.error( "Postgres select operation returned an empty array for a user's creator id that isn't null.", ); + throw new TalawaGraphQLError({ extensions: { code: "unexpected", diff --git a/src/graphql/types/User/educationGrade.ts b/src/graphql/types/User/educationGrade.ts new file mode 100644 index 0000000000..5a8fd82a29 --- /dev/null +++ b/src/graphql/types/User/educationGrade.ts @@ -0,0 +1,51 @@ +import { UserEducationGrade } from "~/src/graphql/enums/UserEducationGrade"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + educationGrade: t.field({ + description: "Primary education grade of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.educationGrade; + }, + type: UserEducationGrade, + }), + }), +}); diff --git a/src/graphql/types/User/emailAddress.ts b/src/graphql/types/User/emailAddress.ts new file mode 100644 index 0000000000..c27e372dfa --- /dev/null +++ b/src/graphql/types/User/emailAddress.ts @@ -0,0 +1,50 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + emailAddress: t.field({ + description: "Email address of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.emailAddress; + }, + type: "EmailAddress", + }), + }), +}); diff --git a/src/graphql/types/User/employmentStatus.ts b/src/graphql/types/User/employmentStatus.ts new file mode 100644 index 0000000000..2faf8bc60e --- /dev/null +++ b/src/graphql/types/User/employmentStatus.ts @@ -0,0 +1,51 @@ +import { UserEmploymentStatus } from "~/src/graphql/enums/UserEmploymentStatus"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + employmentStatus: t.field({ + description: "Employment status of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.employmentStatus; + }, + type: UserEmploymentStatus, + }), + }), +}); diff --git a/src/graphql/types/User/homePhoneNumber.ts b/src/graphql/types/User/homePhoneNumber.ts new file mode 100644 index 0000000000..104cd56b4f --- /dev/null +++ b/src/graphql/types/User/homePhoneNumber.ts @@ -0,0 +1,51 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + homePhoneNumber: t.field({ + description: + "The phone number to use to communicate with the user at their home.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.homePhoneNumber; + }, + type: "PhoneNumber", + }), + }), +}); diff --git a/src/graphql/types/User/index.ts b/src/graphql/types/User/index.ts index d99f78abb5..3bbb6546ba 100644 --- a/src/graphql/types/User/index.ts +++ b/src/graphql/types/User/index.ts @@ -1,6 +1,21 @@ import "./User"; +import "./address"; import "./avatarURL"; +import "./birthDate"; +import "./city"; +import "./countryCode"; import "./creator"; +import "./educationGrade"; +import "./emailAddress"; +import "./employmentStatus"; +import "./homePhoneNumber"; +import "./isEmailAddressVerified"; +import "./maritalStatus"; +import "./mobilePhoneNumber"; +import "./natalSex"; import "./organizationsWhereMember"; +import "./postalCode"; +import "./state"; import "./updatedAt"; import "./updater"; +import "./workPhoneNumber"; diff --git a/src/graphql/types/User/isEmailAddressVerified.ts b/src/graphql/types/User/isEmailAddressVerified.ts new file mode 100644 index 0000000000..759ca87aba --- /dev/null +++ b/src/graphql/types/User/isEmailAddressVerified.ts @@ -0,0 +1,51 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + isEmailAddressVerified: t.field({ + description: + "Boolean to tell whether the user has verified their email address.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.isEmailAddressVerified; + }, + type: "Boolean", + }), + }), +}); diff --git a/src/graphql/types/User/maritalStatus.ts b/src/graphql/types/User/maritalStatus.ts new file mode 100644 index 0000000000..ba372237db --- /dev/null +++ b/src/graphql/types/User/maritalStatus.ts @@ -0,0 +1,51 @@ +import { UserMaritalStatus } from "~/src/graphql/enums/UserMaritalStatus"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + maritalStatus: t.field({ + description: "Marital status of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.maritalStatus; + }, + type: UserMaritalStatus, + }), + }), +}); diff --git a/src/graphql/types/User/mobilePhoneNumber.ts b/src/graphql/types/User/mobilePhoneNumber.ts new file mode 100644 index 0000000000..1a749652ec --- /dev/null +++ b/src/graphql/types/User/mobilePhoneNumber.ts @@ -0,0 +1,51 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + mobilePhoneNumber: t.field({ + description: + "The phone number to use to communicate with the user on their mobile phone.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.mobilePhoneNumber; + }, + type: "PhoneNumber", + }), + }), +}); diff --git a/src/graphql/types/User/natalSex.ts b/src/graphql/types/User/natalSex.ts new file mode 100644 index 0000000000..6a257885bb --- /dev/null +++ b/src/graphql/types/User/natalSex.ts @@ -0,0 +1,51 @@ +import { UserNatalSex } from "~/src/graphql/enums/UserNatalSex"; +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + natalSex: t.field({ + description: "The sex assigned to the user at their birth.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.natalSex; + }, + type: UserNatalSex, + }), + }), +}); diff --git a/src/graphql/types/User/organizationsWhereMember.ts b/src/graphql/types/User/organizationsWhereMember.ts index 9499099a56..19381d1f0e 100644 --- a/src/graphql/types/User/organizationsWhereMember.ts +++ b/src/graphql/types/User/organizationsWhereMember.ts @@ -59,6 +59,14 @@ User.implement({ description: "GraphQL connection to traverse through the organizations the user is a member of.", resolve: async (parent, args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + const { data: parsedArgs, error, @@ -77,17 +85,42 @@ User.implement({ }); } + const currentUserId = ctx.currentClient.user.id; + + const currentUser = + await ctx.drizzleClient.query.usersTable.findFirst({ + where: (fields, operators) => + operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + currentUserId !== parent.id + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + const { cursor, isInversed, limit } = parsedArgs; const orderBy = isInversed ? [ asc(organizationMembershipsTable.createdAt), - asc(organizationMembershipsTable.memberId), asc(organizationMembershipsTable.organizationId), ] : [ desc(organizationMembershipsTable.createdAt), - desc(organizationMembershipsTable.memberId), desc(organizationMembershipsTable.organizationId), ]; @@ -102,6 +135,10 @@ User.implement({ .from(organizationMembershipsTable) .where( and( + eq( + organizationMembershipsTable.createdAt, + cursor.createdAt, + ), eq(organizationMembershipsTable.memberId, parent.id), eq( organizationMembershipsTable.organizationId, @@ -137,6 +174,10 @@ User.implement({ .from(organizationMembershipsTable) .where( and( + eq( + organizationMembershipsTable.createdAt, + cursor.createdAt, + ), eq(organizationMembershipsTable.memberId, parent.id), eq( organizationMembershipsTable.memberId, @@ -198,7 +239,7 @@ User.implement({ createCursor: (membership) => Buffer.from( JSON.stringify({ - createdAt: membership.createdAt, + createdAt: membership.createdAt.toISOString(), organizationId: membership.organizationId, }), ).toString("base64url"), diff --git a/src/graphql/types/User/postalCode.ts b/src/graphql/types/User/postalCode.ts new file mode 100644 index 0000000000..a9d6ac2dd2 --- /dev/null +++ b/src/graphql/types/User/postalCode.ts @@ -0,0 +1,50 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + postalCode: t.field({ + description: "Postal code of the user.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.postalCode; + }, + type: "String", + }), + }), +}); diff --git a/src/graphql/types/User/state.ts b/src/graphql/types/User/state.ts new file mode 100644 index 0000000000..040d191c68 --- /dev/null +++ b/src/graphql/types/User/state.ts @@ -0,0 +1,50 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + state: t.field({ + description: "Name of the state the user resides in.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.state; + }, + type: "String", + }), + }), +}); diff --git a/src/graphql/types/User/updater.ts b/src/graphql/types/User/updater.ts index 2f94cbce85..8c16191541 100755 --- a/src/graphql/types/User/updater.ts +++ b/src/graphql/types/User/updater.ts @@ -32,6 +32,10 @@ User.implement({ currentUser.role !== "administrator" && currentUserId !== parent.id ) { + console.log("========================"); + console.log(currentUser.role); + console.log("========================"); + throw new TalawaGraphQLError({ extensions: { code: "unauthorized_action", diff --git a/src/graphql/types/User/workPhoneNumber.ts b/src/graphql/types/User/workPhoneNumber.ts new file mode 100644 index 0000000000..b4eead3aca --- /dev/null +++ b/src/graphql/types/User/workPhoneNumber.ts @@ -0,0 +1,51 @@ +import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError"; +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + workPhoneNumber: t.field({ + description: + "The phone number to use to communicate with the user while they're at work.", + resolve: async (parent, _args, ctx) => { + if (!ctx.currentClient.isAuthenticated) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + }); + } + + if ( + currentUser.role !== "administrator" && + parent.id !== currentUserId + ) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + }); + } + + return parent.workPhoneNumber; + }, + type: "PhoneNumber", + }), + }), +}); diff --git a/src/graphql/types/Venue/Venue.ts b/src/graphql/types/Venue/Venue.ts index f21fbfc07c..77103b6b08 100644 --- a/src/graphql/types/Venue/Venue.ts +++ b/src/graphql/types/Venue/Venue.ts @@ -1,7 +1,13 @@ import type { venuesTable } from "~/src/drizzle/tables/venues"; import { builder } from "~/src/graphql/builder"; +import { + VenueAttachment, + type VenueAttachment as VenueAttachmentType, +} from "~/src/graphql/types/VenueAttachment/VenueAttachment"; -export type Venue = typeof venuesTable.$inferSelect; +export type Venue = typeof venuesTable.$inferSelect & { + attachments: VenueAttachmentType[] | null; +}; export const Venue = builder.objectRef<Venue>("Venue"); @@ -9,6 +15,10 @@ Venue.implement({ description: "Venues are physical locations associated to organizations where they conduct their events.", fields: (t) => ({ + attachments: t.expose("attachments", { + description: "Array of attachments.", + type: t.listRef(VenueAttachment), + }), description: t.exposeString("description", { description: "Custom information about the venue.", }), diff --git a/src/graphql/types/Venue/createdAt.ts b/src/graphql/types/Venue/createdAt.ts index b0760f10e4..7566cb8e5e 100644 --- a/src/graphql/types/Venue/createdAt.ts +++ b/src/graphql/types/Venue/createdAt.ts @@ -4,7 +4,7 @@ import { Venue } from "./Venue"; Venue.implement({ fields: (t) => ({ createdAt: t.field({ - description: "Date time at the time the venue was first created.", + description: "Date time at the time the venue was created.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Venue/creator.ts b/src/graphql/types/Venue/creator.ts index 5f80172700..afd0620e55 100644 --- a/src/graphql/types/Venue/creator.ts +++ b/src/graphql/types/Venue/creator.ts @@ -5,7 +5,7 @@ import { Venue } from "./Venue"; Venue.implement({ fields: (t) => ({ creator: t.field({ - description: "User who first created the venue.", + description: "User who created the venue.", resolve: async (parent, _args, ctx) => { if (!ctx.currentClient.isAuthenticated) { throw new TalawaGraphQLError({ diff --git a/src/graphql/types/Venue/events.ts b/src/graphql/types/Venue/events.ts index 5365a2a438..ef85294317 100644 --- a/src/graphql/types/Venue/events.ts +++ b/src/graphql/types/Venue/events.ts @@ -1,5 +1,5 @@ import { type SQL, and, asc, desc, eq, exists, gt, lt, or } from "drizzle-orm"; -import type { z } from "zod"; +import { z } from "zod"; import { venueBookingsTable, venueBookingsTableInsertSchema, @@ -44,8 +44,12 @@ const cursorSchema = venueBookingsTableInsertSchema eventId: true, }) .extend({ - createdAt: venueBookingsTableInsertSchema.shape.createdAt.unwrap(), - }); + createdAt: z.string().datetime(), + }) + .transform((arg) => ({ + createdAt: new Date(arg.createdAt), + eventId: arg.eventId, + })); Venue.implement({ fields: (t) => ({ @@ -129,12 +133,10 @@ Venue.implement({ ? [ asc(venueBookingsTable.createdAt), asc(venueBookingsTable.eventId), - asc(venueBookingsTable.venueId), ] : [ desc(venueBookingsTable.createdAt), desc(venueBookingsTable.eventId), - desc(venueBookingsTable.venueId), ]; let where: SQL | undefined; @@ -230,7 +232,7 @@ Venue.implement({ createCursor: (booking) => Buffer.from( JSON.stringify({ - createdAt: booking.createdAt, + createdAt: booking.createdAt.toISOString(), eventId: booking.eventId, }), ).toString("base64url"), diff --git a/src/utilities/TalawaGraphQLError.ts b/src/utilities/TalawaGraphQLError.ts index e1c21c8a13..1c403beff0 100644 --- a/src/utilities/TalawaGraphQLError.ts +++ b/src/utilities/TalawaGraphQLError.ts @@ -4,7 +4,7 @@ import { type GraphQLFormattedError, } from "graphql"; -//The term action used below is used to refer to read and write operations triggered by the clients. In the context of graphql query, mutation and subscription are the three possible ways to perform these actions. +// The term action used below is used to refer to read and write operations triggered by the clients. In the context of graphql query, mutation and subscription are the three possible ways to perform these actions. // The term resource used below is used to refer to any entity that the client can perform an action on. These can be both coarse and fine grained entities. One example for a coarse grained entity would be the account of a user and one example for a fine grained entity would be the email address of a user. @@ -12,10 +12,11 @@ import { * When resources associated to the provided graphql arguments cannot be not found. * * @example - * throw new TalawaGraphQLError("No posts found for some of the provided arguments.", { - * code: "arguments_associated_resources_not_found" - * issues: [ - * { + * throw new TalawaGraphQLError({ + * extensions: { + * code: "arguments_associated_resources_not_found", + * issues: [ + * { * argumentPath: ["input", 0, "id"], * }, * { @@ -24,8 +25,9 @@ import { * { * argumentPath: ["input", 19, "id"], * }, - * ], - * }); + * ], + * }, + * }); */ export type ArgumentsAssociatedResourcesNotFoundExtensions = { code: "arguments_associated_resources_not_found"; @@ -38,10 +40,13 @@ export type ArgumentsAssociatedResourcesNotFoundExtensions = { * When the client tries to perform an action that conflicts with real world expectations of the application. * * @example - * throw new TalawaGraphQLError("You can only claim your yearly award once per year.", - * { - * code: "forbidden_action" - * }) + * throw new TalawaGraphQLError( + * { + * extensions: { + * code: "forbidden_action", + * }, + * }, + * ); */ export type ForbiddenActionExtensions = { code: "forbidden_action"; @@ -51,22 +56,21 @@ export type ForbiddenActionExtensions = { * When the client tries to perform actions on resources associated to arguments that conflict with real world expectations of the application. One example would be a user trying to follow their own account on a social media application. * * @example - * throw new TalawaGraphQLError({ - * extensions: { - * code: "forbidden_action_on_arguments_associated_resources", - * issues: [ - * { - * argumentPath: ["input", 0, "emailAddress"], - * message: "This email address is not available.", - * }, - * { - * argumentPath: ["input", 3, "username"], - * message: "This username is not available.", - * }, - * ], - * }, - * message: "This action is forbidden on the resources associated to the provided arguments." - * }); + * throw new TalawaGraphQLError({ + * extensions: { + * code: "forbidden_action_on_arguments_associated_resources", + * issues: [ + * { + * argumentPath: ["input", 0, "emailAddress"], + * message: "This email address is not available.", + * }, + * { + * argumentPath: ["input", 3, "username"], + * message: "This username is not available.", + * }, + * ], + * }, + * }); */ export type ForbiddenActionOnArgumentsAssociatedResourcesExtensions = { code: "forbidden_action_on_arguments_associated_resources"; @@ -81,11 +85,10 @@ export type ForbiddenActionOnArgumentsAssociatedResourcesExtensions = { * * @example * throw new TalawaGraphQLError({ - * extensions: { - * code: "unauthenticated" - * }, - * - * }) + * extensions: { + * code: "unauthenticated", + * }, + * }); */ export type UnauthenticatedExtensions = { code: "unauthenticated"; @@ -96,25 +99,24 @@ export type UnauthenticatedExtensions = { * * @example * throw new TalawaGraphQLError({ - * extensions: { - * code: "invalid_arguments", - * issues: [ - * { - * argumentPath: ["input", "age"], - * message: "Must be greater than 18." - * }, - * { - * argumentPath: ["input", "username"], - * message: "Must be smaller than or equal to 25 characters." - * }, - * { - * argumentPath: ["input", "favoriteFood", 2], - * message: "Must be at least 1 character long." - * }, - * ], - * }, - * - * }) + * extensions: { + * code: "invalid_arguments", + * issues: [ + * { + * argumentPath: ["input", "age"], + * message: "Must be greater than 18.", + * }, + * { + * argumentPath: ["input", "username"], + * message: "Must be smaller than or equal to 25 characters.", + * }, + * { + * argumentPath: ["input", "favoriteFood", 2], + * message: "Must be at least 1 character long.", + * }, + * ], + * }, + * }); */ export type InvalidArgumentsExtensions = { code: "invalid_arguments"; @@ -129,11 +131,10 @@ export type InvalidArgumentsExtensions = { * * @example * throw new TalawaGraphQLError({ - * extensions: { - * code: "unauthorized_action" - * }, - * message: "You are not authorized to perform this action." - * }) + * extensions: { + * code: "unauthorized_action", + * }, + * }); */ export type UnauthorizedActionExtensions = { code: "unauthorized_action"; @@ -144,17 +145,15 @@ export type UnauthorizedActionExtensions = { * * @example * throw new TalawaGraphQLError({ - * extensions: { - * code: "unauthorized_action_on_arguments_associated_resources", - * issues: [ - * { - * argumentPath: ["input", "id"], - * message: "You must be an approved member of this organization to access it.", - * }, - * ], - * }, - * message: "You are not authorized to perform this action on the resources associated to the provided arguments." - * }) + * extensions: { + * code: "unauthorized_action_on_arguments_associated_resources", + * issues: [ + * { + * argumentPath: ["input", "id"], + * }, + * ], + * }, + * }); */ export type UnauthorizedActionOnArgumentsAssociatedResourcesExtensions = { issues: { @@ -168,17 +167,16 @@ export type UnauthorizedActionOnArgumentsAssociatedResourcesExtensions = { * * @example * throw new TalawaGraphQLError({ - * extensions: { - * code: "unauthorized_arguments", - * issues: [ - * { - * argumentPath: ["input", "role"], - * message: "You are not authorzied to change your user role.", - * }, - * ], - * }, - * message: "You are not authorized to perform this action with the provided arguments." - * }) + * extensions: { + * code: "unauthorized_arguments", + * issues: [ + * { + * argumentPath: ["input", "role"], + * message: "You are not authorzied to change your user role.", + * }, + * ], + * }, + * }); */ export type UnauthorizedArgumentsExtensions = { issues: { @@ -192,11 +190,10 @@ export type UnauthorizedArgumentsExtensions = { * * @example * throw new TalawaGraphQLError({ - * extensions: { - * code: "unexpected" - * }, - * message: "Something went wrong. Please try again later.", - * }) + * extensions: { + * code: "unexpected", + * }, + * }); */ export type UnexpectedExtensions = { code: "unexpected"; diff --git a/test/routes/graphql/Mutation/deleteCurrentUser.test.ts b/test/routes/graphql/Mutation/deleteCurrentUser.test.ts index 638532f638..fd51b39f10 100644 --- a/test/routes/graphql/Mutation/deleteCurrentUser.test.ts +++ b/test/routes/graphql/Mutation/deleteCurrentUser.test.ts @@ -161,8 +161,8 @@ suite("Mutation field deleteCurrentUser", () => { assertToBeNonNullish(createUserResult.data.createUser.user); expect(deleteCurrentUserResult.errors).toBeUndefined(); - expect(deleteCurrentUserResult.data.deleteCurrentUser).toEqual( - createUserResult.data.createUser.user, + expect(deleteCurrentUserResult.data.deleteCurrentUser?.id).toEqual( + createUserResult.data.createUser.user.id, ); }); }); diff --git a/test/routes/graphql/Query/user.test.ts b/test/routes/graphql/Query/user.test.ts index 1aade1a495..14af3e4421 100644 --- a/test/routes/graphql/Query/user.test.ts +++ b/test/routes/graphql/Query/user.test.ts @@ -155,9 +155,16 @@ suite("Query field user", () => { }, ); + assertToBeNonNullish( + administratorUserSignInResult.data.signIn?.authenticationToken, + ); + assertToBeNonNullish(administratorUserSignInResult.data.signIn?.user?.id); const userResult = await mercuriusClient.query(Query_user, { + headers: { + authorization: `bearer ${administratorUserSignInResult.data.signIn.authenticationToken}`, + }, variables: { input: { id: administratorUserSignInResult.data.signIn.user.id, diff --git a/test/routes/graphql/documentNodes.ts b/test/routes/graphql/documentNodes.ts index 2d621539eb..caa56a7d71 100644 --- a/test/routes/graphql/documentNodes.ts +++ b/test/routes/graphql/documentNodes.ts @@ -41,26 +41,7 @@ export const Mutation_createUser = export const Mutation_deleteCurrentUser = gql(`mutation Mutation_deleteCurrentUser { deleteCurrentUser { - address - birthDate - city - countryCode - createdAt - description - educationGrade - emailAddress - employmentStatus - homePhoneNumber - id - isEmailAddressVerified - maritalStatus - mobilePhoneNumber - name - natalSex - postalCode - role - state - workPhoneNumber + id } }`); diff --git a/test/routes/graphql/gql.tada-cache.d.ts b/test/routes/graphql/gql.tada-cache.d.ts index bbc4fc8301..482ebc0ce8 100644 --- a/test/routes/graphql/gql.tada-cache.d.ts +++ b/test/routes/graphql/gql.tada-cache.d.ts @@ -6,8 +6,8 @@ declare module 'gql.tada' { interface setupCache { "mutation Mutation_createUser($input: MutationCreateUserInput!) {\n createUser(input: $input){\n authenticationToken\n user {\n address\n birthDate\n city\n countryCode\n createdAt\n description\n educationGrade\n emailAddress\n employmentStatus\n homePhoneNumber\n id\n isEmailAddressVerified\n maritalStatus\n mobilePhoneNumber\n name\n natalSex\n postalCode\n role\n state\n workPhoneNumber\n }\n }\n}": TadaDocumentNode<{ createUser: { authenticationToken: string | null; user: { address: string | null; birthDate: string | null; city: string | null; countryCode: "at" | "pg" | "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "ao" | "aq" | "ar" | "as" | "au" | "aw" | "ax" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bl" | "bm" | "bn" | "bo" | "bq" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ci" | "ck" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cv" | "cw" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gb" | "gd" | "ge" | "gf" | "gg" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "im" | "in" | "io" | "iq" | "ir" | "is" | "it" | "je" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mf" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "ph" | "pk" | "pl" | "pm" | "pn" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "ss" | "st" | "sv" | "sx" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tl" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "um" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "ye" | "yt" | "za" | "zm" | "zw" | null; createdAt: string | null; description: string | null; educationGrade: "kg" | "grade_1" | "grade_2" | "grade_3" | "grade_4" | "grade_5" | "grade_6" | "grade_7" | "grade_8" | "grade_9" | "grade_10" | "grade_11" | "grade_12" | "graduate" | "no_grade" | "pre_kg" | null; emailAddress: string | null; employmentStatus: "full_time" | "part_time" | "unemployed" | null; homePhoneNumber: string | null; id: string; isEmailAddressVerified: boolean | null; maritalStatus: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null; mobilePhoneNumber: string | null; name: string | null; natalSex: "female" | "intersex" | "male" | null; postalCode: string | null; role: "administrator" | "regular" | null; state: string | null; workPhoneNumber: string | null; } | null; } | null; }, { input: { workPhoneNumber?: string | null | undefined; state?: string | null | undefined; role: "administrator" | "regular"; postalCode?: string | null | undefined; password: string; natalSex?: "female" | "intersex" | "male" | null | undefined; name: string; mobilePhoneNumber?: string | null | undefined; maritalStatus?: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null | undefined; isEmailAddressVerified: boolean; homePhoneNumber?: string | null | undefined; employmentStatus?: "full_time" | "part_time" | "unemployed" | null | undefined; emailAddress: string; educationGrade?: "kg" | "grade_1" | "grade_2" | "grade_3" | "grade_4" | "grade_5" | "grade_6" | "grade_7" | "grade_8" | "grade_9" | "grade_10" | "grade_11" | "grade_12" | "graduate" | "no_grade" | "pre_kg" | null | undefined; description?: string | null | undefined; countryCode?: "at" | "pg" | "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "ao" | "aq" | "ar" | "as" | "au" | "aw" | "ax" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bl" | "bm" | "bn" | "bo" | "bq" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ci" | "ck" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cv" | "cw" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gb" | "gd" | "ge" | "gf" | "gg" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "im" | "in" | "io" | "iq" | "ir" | "is" | "it" | "je" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mf" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "ph" | "pk" | "pl" | "pm" | "pn" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "ss" | "st" | "sv" | "sx" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tl" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "um" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "ye" | "yt" | "za" | "zm" | "zw" | null | undefined; city?: string | null | undefined; birthDate?: string | null | undefined; avatar?: unknown; address?: string | null | undefined; }; }, void>; - "mutation Mutation_deleteCurrentUser {\n deleteCurrentUser {\n address\n birthDate\n city\n countryCode\n createdAt\n description\n educationGrade\n emailAddress\n employmentStatus\n homePhoneNumber\n id\n isEmailAddressVerified\n maritalStatus\n mobilePhoneNumber\n name\n natalSex\n postalCode\n role\n state\n workPhoneNumber \n }\n}": - TadaDocumentNode<{ deleteCurrentUser: { address: string | null; birthDate: string | null; city: string | null; countryCode: "at" | "pg" | "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "ao" | "aq" | "ar" | "as" | "au" | "aw" | "ax" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bl" | "bm" | "bn" | "bo" | "bq" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ci" | "ck" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cv" | "cw" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gb" | "gd" | "ge" | "gf" | "gg" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "im" | "in" | "io" | "iq" | "ir" | "is" | "it" | "je" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mf" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "ph" | "pk" | "pl" | "pm" | "pn" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "ss" | "st" | "sv" | "sx" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tl" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "um" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "ye" | "yt" | "za" | "zm" | "zw" | null; createdAt: string | null; description: string | null; educationGrade: "kg" | "grade_1" | "grade_2" | "grade_3" | "grade_4" | "grade_5" | "grade_6" | "grade_7" | "grade_8" | "grade_9" | "grade_10" | "grade_11" | "grade_12" | "graduate" | "no_grade" | "pre_kg" | null; emailAddress: string | null; employmentStatus: "full_time" | "part_time" | "unemployed" | null; homePhoneNumber: string | null; id: string; isEmailAddressVerified: boolean | null; maritalStatus: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null; mobilePhoneNumber: string | null; name: string | null; natalSex: "female" | "intersex" | "male" | null; postalCode: string | null; role: "administrator" | "regular" | null; state: string | null; workPhoneNumber: string | null; } | null; }, {}, void>; + "mutation Mutation_deleteCurrentUser {\n deleteCurrentUser {\n id \n }\n}": + TadaDocumentNode<{ deleteCurrentUser: { id: string; } | null; }, {}, void>; "mutation Mutation_deleteUser($input: MutationDeleteUserInput!) {\n deleteUser(input: $input) {\n address\n birthDate\n city\n countryCode\n createdAt\n description\n educationGrade\n emailAddress\n employmentStatus\n homePhoneNumber\n id\n isEmailAddressVerified\n maritalStatus\n mobilePhoneNumber\n name\n natalSex\n postalCode\n role\n state\n workPhoneNumber \n }\n}": TadaDocumentNode<{ deleteUser: { address: string | null; birthDate: string | null; city: string | null; countryCode: "at" | "pg" | "ad" | "ae" | "af" | "ag" | "ai" | "al" | "am" | "ao" | "aq" | "ar" | "as" | "au" | "aw" | "ax" | "az" | "ba" | "bb" | "bd" | "be" | "bf" | "bg" | "bh" | "bi" | "bj" | "bl" | "bm" | "bn" | "bo" | "bq" | "br" | "bs" | "bt" | "bv" | "bw" | "by" | "bz" | "ca" | "cc" | "cd" | "cf" | "cg" | "ch" | "ci" | "ck" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cv" | "cw" | "cx" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "do" | "dz" | "ec" | "ee" | "eg" | "eh" | "er" | "es" | "et" | "fi" | "fj" | "fk" | "fm" | "fo" | "fr" | "ga" | "gb" | "gd" | "ge" | "gf" | "gg" | "gh" | "gi" | "gl" | "gm" | "gn" | "gp" | "gq" | "gr" | "gs" | "gt" | "gu" | "gw" | "gy" | "hk" | "hm" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "im" | "in" | "io" | "iq" | "ir" | "is" | "it" | "je" | "jm" | "jo" | "jp" | "ke" | "kg" | "kh" | "ki" | "km" | "kn" | "kp" | "kr" | "kw" | "ky" | "kz" | "la" | "lb" | "lc" | "li" | "lk" | "lr" | "ls" | "lt" | "lu" | "lv" | "ly" | "ma" | "mc" | "md" | "me" | "mf" | "mg" | "mh" | "mk" | "ml" | "mm" | "mn" | "mo" | "mp" | "mq" | "mr" | "ms" | "mt" | "mu" | "mv" | "mw" | "mx" | "my" | "mz" | "na" | "nc" | "ne" | "nf" | "ng" | "ni" | "nl" | "no" | "np" | "nr" | "nu" | "nz" | "om" | "pa" | "pe" | "pf" | "ph" | "pk" | "pl" | "pm" | "pn" | "pr" | "ps" | "pt" | "pw" | "py" | "qa" | "re" | "ro" | "rs" | "ru" | "rw" | "sa" | "sb" | "sc" | "sd" | "se" | "sg" | "sh" | "si" | "sj" | "sk" | "sl" | "sm" | "sn" | "so" | "sr" | "ss" | "st" | "sv" | "sx" | "sy" | "sz" | "tc" | "td" | "tf" | "tg" | "th" | "tj" | "tk" | "tl" | "tm" | "tn" | "to" | "tr" | "tt" | "tv" | "tw" | "tz" | "ua" | "ug" | "um" | "us" | "uy" | "uz" | "va" | "vc" | "ve" | "vg" | "vi" | "vn" | "vu" | "wf" | "ws" | "ye" | "yt" | "za" | "zm" | "zw" | null; createdAt: string | null; description: string | null; educationGrade: "kg" | "grade_1" | "grade_2" | "grade_3" | "grade_4" | "grade_5" | "grade_6" | "grade_7" | "grade_8" | "grade_9" | "grade_10" | "grade_11" | "grade_12" | "graduate" | "no_grade" | "pre_kg" | null; emailAddress: string | null; employmentStatus: "full_time" | "part_time" | "unemployed" | null; homePhoneNumber: string | null; id: string; isEmailAddressVerified: boolean | null; maritalStatus: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null; mobilePhoneNumber: string | null; name: string | null; natalSex: "female" | "intersex" | "male" | null; postalCode: string | null; role: "administrator" | "regular" | null; state: string | null; workPhoneNumber: string | null; } | null; }, { input: { id: string; }; }, void>; "mutation Mutation_signUp($input: MutationSignUpInput!) {\n signUp(input: $input) {\n authenticationToken\n user {\n address\n birthDate\n city\n countryCode\n createdAt\n description\n educationGrade\n emailAddress\n employmentStatus\n homePhoneNumber\n id\n isEmailAddressVerified\n maritalStatus\n mobilePhoneNumber\n name\n natalSex\n postalCode\n role\n state\n workPhoneNumber\n }\n }\n}": diff --git a/test/routes/graphql/gql.tada.d.ts b/test/routes/graphql/gql.tada.d.ts index 3e7684a2da..f553599c64 100644 --- a/test/routes/graphql/gql.tada.d.ts +++ b/test/routes/graphql/gql.tada.d.ts @@ -19,10 +19,10 @@ export type introspection_types = { 'ChatMembersConnection': { kind: 'OBJECT'; name: 'ChatMembersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'ChatMembersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'ChatMembersConnectionEdge': { kind: 'OBJECT'; name: 'ChatMembersConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'ChatMembershipRole': { name: 'ChatMembershipRole'; enumValues: 'administrator' | 'regular'; }; - 'ChatMessage': { kind: 'OBJECT'; name: 'ChatMessage'; fields: { 'body': { name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chat': { name: 'chat'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'parentChatMessage': { name: 'parentChatMessage'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; }; }; + 'ChatMessage': { kind: 'OBJECT'; name: 'ChatMessage'; fields: { 'body': { name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chat': { name: 'chat'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'parentMessage': { name: 'parentMessage'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; }; }; 'ChatMessagesConnection': { kind: 'OBJECT'; name: 'ChatMessagesConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'ChatMessagesConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'ChatMessagesConnectionEdge': { kind: 'OBJECT'; name: 'ChatMessagesConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; }; }; - 'Comment': { kind: 'OBJECT'; name: 'Comment'; fields: { 'body': { name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'downVoters': { name: 'downVoters'; type: { kind: 'OBJECT'; name: 'CommentDownVotersConnection'; ofType: null; } }; 'downVotesCount': { name: 'downVotesCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'post': { name: 'post'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'upVoters': { name: 'upVoters'; type: { kind: 'OBJECT'; name: 'CommentUpVotersConnection'; ofType: null; } }; 'upVotesCount': { name: 'upVotesCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'Comment': { kind: 'OBJECT'; name: 'Comment'; fields: { 'body': { name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'downVoters': { name: 'downVoters'; type: { kind: 'OBJECT'; name: 'CommentDownVotersConnection'; ofType: null; } }; 'downVotesCount': { name: 'downVotesCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'post': { name: 'post'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'upVoters': { name: 'upVoters'; type: { kind: 'OBJECT'; name: 'CommentUpVotersConnection'; ofType: null; } }; 'upVotesCount': { name: 'upVotesCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; }; }; 'CommentDownVotersConnection': { kind: 'OBJECT'; name: 'CommentDownVotersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'CommentDownVotersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'CommentDownVotersConnectionEdge': { kind: 'OBJECT'; name: 'CommentDownVotersConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'CommentUpVotersConnection': { kind: 'OBJECT'; name: 'CommentUpVotersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'CommentUpVotersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; @@ -54,7 +54,7 @@ export type introspection_types = { 'MutationCreateAgendaItemInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateAgendaItemInput'; isOneOf: false; inputFields: [{ name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'duration'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'folderId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'key'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'AgendaItemType'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateChatInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateChatInput'; isOneOf: false; inputFields: [{ name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateChatMembershipInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateChatMembershipInput'; isOneOf: false; inputFields: [{ name: 'chatId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'memberId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'role'; type: { kind: 'ENUM'; name: 'ChatMembershipRole'; ofType: null; }; defaultValue: null }]; }; - 'MutationCreateChatMessageInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateChatMessageInput'; isOneOf: false; inputFields: [{ name: 'body'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'chatId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'parentChatMessageId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationCreateChatMessageInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateChatMessageInput'; isOneOf: false; inputFields: [{ name: 'body'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'chatId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'parentMessageId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateCommentInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateCommentInput'; isOneOf: false; inputFields: [{ name: 'body'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'postId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateCommentVoteInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateCommentVoteInput'; isOneOf: false; inputFields: [{ name: 'commentId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'CommentVoteType'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateEventInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateEventInput'; isOneOf: false; inputFields: [{ name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; }; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'endAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'startAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; }; defaultValue: null }]; }; @@ -167,7 +167,9 @@ export type introspection_types = { 'String': unknown; 'Subscription': { kind: 'OBJECT'; name: 'Subscription'; fields: { 'chatMessageCreate': { name: 'chatMessageCreate'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; }; }; 'SubscriptionChatMessageCreateInput': { kind: 'INPUT_OBJECT'; name: 'SubscriptionChatMessageCreateInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; - 'Tag': { kind: 'OBJECT'; name: 'Tag'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'folder': { name: 'folder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'Tag': { kind: 'OBJECT'; name: 'Tag'; fields: { 'assignees': { name: 'assignees'; type: { kind: 'OBJECT'; name: 'TagAssigneesConnection'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'folder': { name: 'folder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'TagAssigneesConnection': { kind: 'OBJECT'; name: 'TagAssigneesConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'TagAssigneesConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'TagAssigneesConnectionEdge': { kind: 'OBJECT'; name: 'TagAssigneesConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'TagFolder': { kind: 'OBJECT'; name: 'TagFolder'; fields: { 'childFolders': { name: 'childFolders'; type: { kind: 'OBJECT'; name: 'TagFolderChildFoldersConnection'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'parentFolder': { name: 'parentFolder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'tags': { name: 'tags'; type: { kind: 'OBJECT'; name: 'TagFolderTagsConnection'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'TagFolderChildFoldersConnection': { kind: 'OBJECT'; name: 'TagFolderChildFoldersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'TagFolderChildFoldersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'TagFolderChildFoldersConnectionEdge': { kind: 'OBJECT'; name: 'TagFolderChildFoldersConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; }; }; @@ -182,7 +184,7 @@ export type introspection_types = { 'UserOrganizationsWhereMemberConnection': { kind: 'OBJECT'; name: 'UserOrganizationsWhereMemberConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'UserOrganizationsWhereMemberConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'UserOrganizationsWhereMemberConnectionEdge': { kind: 'OBJECT'; name: 'UserOrganizationsWhereMemberConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; }; }; 'UserRole': { name: 'UserRole'; enumValues: 'administrator' | 'regular'; }; - 'Venue': { kind: 'OBJECT'; name: 'Venue'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'events': { name: 'events'; type: { kind: 'OBJECT'; name: 'VenueEventsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'Venue': { kind: 'OBJECT'; name: 'Venue'; fields: { 'attachments': { name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'VenueAttachment'; ofType: null; }; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'events': { name: 'events'; type: { kind: 'OBJECT'; name: 'VenueEventsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'VenueAttachment': { kind: 'OBJECT'; name: 'VenueAttachment'; fields: { 'mimeType': { name: 'mimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'url': { name: 'url'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; 'VenueEventsConnection': { kind: 'OBJECT'; name: 'VenueEventsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'VenueEventsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'VenueEventsConnectionEdge': { kind: 'OBJECT'; name: 'VenueEventsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Event'; ofType: null; } }; }; };