From 9a5a8c6bd641c8232fb5bf9eee5ffdb6a9271156 Mon Sep 17 00:00:00 2001 From: xoldd Date: Wed, 1 Jan 2025 00:19:37 +0530 Subject: [PATCH] add minio implementation (#2817) * integrate minio added docker configuration and environment variables for minio integrated minio client fastify plugin instance into the talawa api server and the mercurius graphql handler exposed a new `/objects` route for streaming the files from minio server to the clients * add graphql implementation for file upload scalar * remove noUncheckedIndexAccess from tsconfig.json * add graphql implementation for deleting minio objects added the implementation for deleting minio objects associated to the postgres entities at the time of their deletion in a transaction * replace _ with - in minio docker service names --- compose.yaml | 53 +- docker/compose.development.yaml | 28 +- docker/compose.testing.yaml | 49 +- ...ql => 20241231123945_true_dorian_gray.sql} | 31 +- ...shot.json => 20241231123945_snapshot.json} | 96 +- drizzle_migrations/meta/_journal.json | 4 +- envFiles/.env.ci | 21 +- envFiles/.env.development | 29 +- envFiles/.env.production | 14 +- package.json | 8 +- pnpm-lock.yaml | 598 ++++++++-- schema.graphql | 1047 +++++++++++++++-- .../enums/advertisementAttachmentMimeType.ts | 11 + .../enums/advertisementAttachmentType.ts | 6 - src/drizzle/enums/eventAttachmentMimeType.ts | 11 + src/drizzle/enums/eventAttachmentType.ts | 6 - src/drizzle/enums/imageMimeType.ts | 11 + src/drizzle/enums/postAttachmentMimeType.ts | 11 + src/drizzle/enums/postAttachmentType.ts | 6 - src/drizzle/enums/venueAttachmentMimeType.ts | 11 + src/drizzle/enums/venueAttachmentType.ts | 6 - src/drizzle/enums/videoMimeType.ts | 6 + .../tables/advertisementAttachments.ts | 18 +- src/drizzle/tables/advertisements.ts | 2 +- src/drizzle/tables/chats.ts | 15 +- src/drizzle/tables/eventAttachments.ts | 18 +- src/drizzle/tables/organizations.ts | 13 +- src/drizzle/tables/postAttachments.ts | 18 +- src/drizzle/tables/users.ts | 13 +- src/drizzle/tables/venueAttachments.ts | 22 +- src/envConfigSchema.ts | 42 +- src/graphql/context.ts | 10 +- .../enums/AdvertisementAttachmentType.ts | 10 - src/graphql/enums/EventAttachmentType.ts | 7 - src/graphql/enums/PostAttachmentType.ts | 7 - src/graphql/enums/VenueAttachmentType.ts | 7 - src/graphql/enums/index.ts | 4 - .../CreateAdvertisementAttachmentInput.ts | 29 - .../inputs/CreateEventAttachmentInput.ts | 29 - .../inputs/CreatePostAttachmentInput.ts | 29 - .../inputs/CreateVenueAttachmentInput.ts | 29 - .../MutationCreateAdvertisementInput.ts | 12 +- src/graphql/inputs/MutationCreateChatInput.ts | 23 +- .../inputs/MutationCreateEventInput.ts | 12 +- .../inputs/MutationCreateOrganizationInput.ts | 28 +- src/graphql/inputs/MutationCreatePostInput.ts | 10 +- src/graphql/inputs/MutationCreateUserInput.ts | 9 +- .../inputs/MutationCreateVenueInput.ts | 12 +- src/graphql/inputs/MutationSignUpInput.ts | 9 +- src/graphql/inputs/MutationUpdateChatInput.ts | 10 +- .../inputs/MutationUpdateCurrentUserInput.ts | 9 +- .../inputs/MutationUpdateOrganizationInput.ts | 23 +- src/graphql/inputs/MutationUpdateUserInput.ts | 9 +- src/graphql/inputs/index.ts | 4 - src/graphql/scalars/Upload.ts | 20 + src/graphql/scalars/index.ts | 3 + .../types/Advertisement/Advertisement.ts | 2 +- .../AdvertisementAttachment.ts | 9 +- .../types/AdvertisementAttachment/index.ts | 1 + .../types/AdvertisementAttachment/url.ts | 15 + src/graphql/types/AgendaFolder/createdAt.ts | 8 +- src/graphql/types/AgendaFolder/creator.ts | 8 +- src/graphql/types/AgendaFolder/event.ts | 4 +- .../types/AgendaFolder/parentFolder.ts | 8 +- src/graphql/types/AgendaFolder/updatedAt.ts | 8 +- src/graphql/types/AgendaFolder/updater.ts | 8 +- src/graphql/types/AgendaItem/createdAt.ts | 12 +- src/graphql/types/AgendaItem/creator.ts | 12 +- src/graphql/types/AgendaItem/folder.ts | 8 +- src/graphql/types/AgendaItem/updatedAt.ts | 12 +- src/graphql/types/AgendaItem/updater.ts | 12 +- src/graphql/types/Chat/Chat.ts | 4 +- src/graphql/types/Chat/avatarURL.ts | 15 + src/graphql/types/Chat/index.ts | 1 + src/graphql/types/Comment/updater.ts | 8 +- .../types/EventAttachment/EventAttachment.ts | 9 +- src/graphql/types/EventAttachment/index.ts | 1 + src/graphql/types/EventAttachment/url.ts | 15 + src/graphql/types/FundCampaign/createdAt.ts | 8 +- src/graphql/types/FundCampaign/creator.ts | 8 +- src/graphql/types/FundCampaign/updatedAt.ts | 8 +- src/graphql/types/FundCampaign/updater.ts | 8 +- .../types/FundCampaignPledge/createdAt.ts | 12 +- .../types/FundCampaignPledge/creator.ts | 12 +- .../types/FundCampaignPledge/pledger.ts | 12 +- .../types/FundCampaignPledge/updatedAt.ts | 12 +- .../types/FundCampaignPledge/updater.ts | 12 +- .../types/Mutation/createAdvertisement.ts | 73 +- .../types/Mutation/createAgendaFolder.ts | 8 +- .../types/Mutation/createAgendaItem.ts | 8 +- src/graphql/types/Mutation/createChat.ts | 113 +- .../types/Mutation/createChatMembership.ts | 4 +- .../types/Mutation/createChatMessage.ts | 16 +- src/graphql/types/Mutation/createComment.ts | 8 +- .../types/Mutation/createCommentVote.ts | 8 +- src/graphql/types/Mutation/createEvent.ts | 73 +- src/graphql/types/Mutation/createFund.ts | 8 +- .../types/Mutation/createFundCampaign.ts | 12 +- .../Mutation/createFundCampaignPledge.ts | 12 +- .../types/Mutation/createOrganization.ts | 118 +- src/graphql/types/Mutation/createPost.ts | 73 +- src/graphql/types/Mutation/createPostVote.ts | 8 +- src/graphql/types/Mutation/createTag.ts | 8 +- src/graphql/types/Mutation/createTagFolder.ts | 4 +- src/graphql/types/Mutation/createUser.ts | 168 ++- src/graphql/types/Mutation/createVenue.ts | 79 +- .../types/Mutation/createVenueBooking.ts | 12 +- .../types/Mutation/deleteAdvertisement.ts | 49 +- .../types/Mutation/deleteAgendaFolder.ts | 12 +- .../types/Mutation/deleteAgendaItem.ts | 16 +- src/graphql/types/Mutation/deleteChat.ts | 45 +- .../types/Mutation/deleteChatMembership.ts | 8 +- .../types/Mutation/deleteChatMessage.ts | 8 +- src/graphql/types/Mutation/deleteComment.ts | 8 +- .../types/Mutation/deleteCommentVote.ts | 8 +- .../types/Mutation/deleteCurrentUser.ts | 41 +- src/graphql/types/Mutation/deleteEvent.ts | 47 +- src/graphql/types/Mutation/deleteFund.ts | 8 +- .../types/Mutation/deleteFundCampaign.ts | 12 +- .../Mutation/deleteFundCampaignPledge.ts | 12 +- .../types/Mutation/deleteOrganization.ts | 131 ++- .../Mutation/deleteOrganizationMembership.ts | 4 +- src/graphql/types/Mutation/deletePost.ts | 43 +- src/graphql/types/Mutation/deletePostVote.ts | 8 +- src/graphql/types/Mutation/deleteTag.ts | 8 +- src/graphql/types/Mutation/deleteTagFolder.ts | 8 +- src/graphql/types/Mutation/deleteUser.ts | 76 +- src/graphql/types/Mutation/deleteVenue.ts | 47 +- .../types/Mutation/deleteVenueBooking.ts | 12 +- src/graphql/types/Mutation/signUp.ts | 141 ++- .../types/Mutation/updateAdvertisement.ts | 8 +- .../types/Mutation/updateAgendaFolder.ts | 8 +- .../types/Mutation/updateAgendaItem.ts | 8 +- src/graphql/types/Mutation/updateChat.ts | 126 +- .../types/Mutation/updateChatMembership.ts | 8 +- .../types/Mutation/updateChatMessage.ts | 12 +- src/graphql/types/Mutation/updateComment.ts | 8 +- .../types/Mutation/updateCommentVote.ts | 12 +- .../types/Mutation/updateCurrentUser.ts | 159 ++- src/graphql/types/Mutation/updateEvent.ts | 4 +- src/graphql/types/Mutation/updateFund.ts | 8 +- .../types/Mutation/updateFundCampaign.ts | 12 +- .../Mutation/updateFundCampaignPledge.ts | 12 +- .../types/Mutation/updateOrganization.ts | 172 ++- .../Mutation/updateOrganizationMembership.ts | 4 +- src/graphql/types/Mutation/updatePost.ts | 4 +- src/graphql/types/Mutation/updatePostVote.ts | 8 +- src/graphql/types/Mutation/updateTag.ts | 8 +- src/graphql/types/Mutation/updateTagFolder.ts | 4 +- src/graphql/types/Mutation/updateUser.ts | 162 ++- src/graphql/types/Mutation/updateVenue.ts | 4 +- .../types/Organization/Organization.ts | 4 +- .../types/Organization/advertisements.ts | 4 +- src/graphql/types/Organization/avatarURL.ts | 15 + src/graphql/types/Organization/events.ts | 4 +- src/graphql/types/Organization/index.ts | 1 + src/graphql/types/Organization/pinnedPosts.ts | 4 +- src/graphql/types/Organization/posts.ts | 4 +- src/graphql/types/Organization/tagFolders.ts | 4 +- src/graphql/types/Organization/tags.ts | 4 +- src/graphql/types/Organization/venues.ts | 4 +- .../types/PostAttachment/PostAttachment.ts | 9 +- src/graphql/types/PostAttachment/index.ts | 1 + src/graphql/types/PostAttachment/url.ts | 15 + src/graphql/types/Query/advertisement.ts | 8 +- src/graphql/types/Query/agendaFolder.ts | 12 +- src/graphql/types/Query/agendaItem.ts | 16 +- src/graphql/types/Query/chat.ts | 8 +- src/graphql/types/Query/chatMessage.ts | 12 +- src/graphql/types/Query/comment.ts | 12 +- 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/post.ts | 8 +- src/graphql/types/Query/tag.ts | 8 +- src/graphql/types/Query/tagFolder.ts | 4 +- src/graphql/types/Query/venue.ts | 8 +- .../types/Subscription/chatMessageCreate.ts | 4 +- src/graphql/types/User/User.ts | 4 +- src/graphql/types/User/avatarURL.ts | 15 + src/graphql/types/User/index.ts | 1 + .../types/VenueAttachment/VenueAttachment.ts | 9 +- src/graphql/types/VenueAttachment/index.ts | 1 + src/graphql/types/VenueAttachment/url.ts | 15 + src/plugins/drizzleClient.ts | 4 +- src/plugins/index.ts | 2 + src/plugins/minioClient.ts | 74 ++ src/plugins/seedPostgres.ts | 53 +- src/routes/graphql.ts | 26 + src/routes/index.ts | 2 + src/routes/objects.ts | 66 ++ .../graphql/Mutation/createUser.test.ts | 31 +- .../Mutation/deleteCurrentUser.test.ts | 4 +- .../graphql/Mutation/deleteUser.test.ts | 12 +- test/routes/graphql/Mutation/signUp.test.ts | 21 +- .../Mutation/updateCurrentUser.test.ts | 25 +- .../graphql/Mutation/updateUser.test.ts | 121 +- test/routes/graphql/Query/currentUser.test.ts | 2 +- .../Query/renewAuthenticationToken.test.ts | 2 +- test/routes/graphql/Query/signIn.test.ts | 8 +- test/routes/graphql/Query/user.test.ts | 2 +- test/routes/graphql/User/creator.test.ts | 10 +- test/routes/graphql/User/updatedAt.test.ts | 10 +- test/routes/graphql/User/updater.test.ts | 6 +- test/routes/graphql/documentNodes.ts | 11 - test/routes/graphql/gql.tada-cache.d.ts | 44 +- test/routes/graphql/gql.tada.d.ts | 115 +- test/server.ts | 5 + tsconfig.json | 1 - 210 files changed, 4756 insertions(+), 1317 deletions(-) rename drizzle_migrations/{20241226151206_massive_grey_gargoyle.sql => 20241231123945_true_dorian_gray.sql} (99%) rename drizzle_migrations/meta/{20241226151206_snapshot.json => 20241231123945_snapshot.json} (99%) create mode 100644 src/drizzle/enums/advertisementAttachmentMimeType.ts delete mode 100644 src/drizzle/enums/advertisementAttachmentType.ts create mode 100644 src/drizzle/enums/eventAttachmentMimeType.ts delete mode 100644 src/drizzle/enums/eventAttachmentType.ts create mode 100644 src/drizzle/enums/imageMimeType.ts create mode 100644 src/drizzle/enums/postAttachmentMimeType.ts delete mode 100644 src/drizzle/enums/postAttachmentType.ts create mode 100644 src/drizzle/enums/venueAttachmentMimeType.ts delete mode 100644 src/drizzle/enums/venueAttachmentType.ts create mode 100644 src/drizzle/enums/videoMimeType.ts delete mode 100755 src/graphql/enums/AdvertisementAttachmentType.ts delete mode 100644 src/graphql/enums/EventAttachmentType.ts delete mode 100755 src/graphql/enums/PostAttachmentType.ts delete mode 100644 src/graphql/enums/VenueAttachmentType.ts delete mode 100644 src/graphql/inputs/CreateAdvertisementAttachmentInput.ts delete mode 100644 src/graphql/inputs/CreateEventAttachmentInput.ts delete mode 100644 src/graphql/inputs/CreatePostAttachmentInput.ts delete mode 100644 src/graphql/inputs/CreateVenueAttachmentInput.ts create mode 100644 src/graphql/scalars/Upload.ts create mode 100644 src/graphql/types/AdvertisementAttachment/url.ts create mode 100644 src/graphql/types/Chat/avatarURL.ts create mode 100644 src/graphql/types/EventAttachment/url.ts create mode 100644 src/graphql/types/Organization/avatarURL.ts create mode 100644 src/graphql/types/PostAttachment/url.ts create mode 100644 src/graphql/types/User/avatarURL.ts create mode 100644 src/graphql/types/VenueAttachment/url.ts create mode 100644 src/plugins/minioClient.ts create mode 100644 src/routes/objects.ts diff --git a/compose.yaml b/compose.yaml index 816862d4744..bcab0f7d792 100644 --- a/compose.yaml +++ b/compose.yaml @@ -2,6 +2,7 @@ name: ${COMPOSE_PROJECT_NAME:?error} # https://docs.docker.com/reference/compose-file/networks/ networks: api: + minio: postgres: # https://docs.docker.com/reference/compose-file/services services: @@ -20,6 +21,10 @@ services: target: production # https://docs.docker.com/reference/compose-file/services/#depends_on depends_on: + minio: + condition: service_healthy + # Should be set to false when a third party minio service could be used in the api service and the `minio` compose profile is disabled. + required: false postgres: condition: service_healthy # Should be set to false when a third party postgres service could be used in the api service the and the `postgres` compose profile is disabled. @@ -29,6 +34,7 @@ services: environment: - API_ADMINISTRATOR_USER_EMAIL_ADDRESS=${API_ADMINISTRATOR_USER_EMAIL_ADDRESS:?error} - API_ADMINISTRATOR_USER_PASSWORD=${API_ADMINISTRATOR_USER_PASSWORD:?error} + - API_BASE_URL=${API_BASE_URL:?error} - API_HOST=${API_HOST:?error} - API_IS_APPLY_DRIZZLE_MIGRATIONS=${API_IS_APPLY_DRIZZLE_MIGRATIONS:?error} - API_IS_GRAPHIQL=${API_IS_GRAPHIQL:?error} @@ -36,6 +42,11 @@ services: - API_JWT_EXPIRES_IN=${API_JWT_EXPIRES_IN:?error} - API_JWT_SECRET=${API_JWT_SECRET:?error} - API_LOG_LEVEL=${API_LOG_LEVEL:?error} + - API_MINIO_ACCESS_KEY=${API_MINIO_ACCESS_KEY:?error} + - API_MINIO_END_POINT=${API_MINIO_END_POINT:?error} + - API_MINIO_PORT=${API_MINIO_PORT:?error} + - API_MINIO_SECRET_KEY=${API_MINIO_SECRET_KEY:?error} + - API_MINIO_USE_SSL=${API_MINIO_USE_SSL:?error} - API_PORT=${API_PORT:?error} - API_POSTGRES_DATABASE=${API_POSTGRES_DATABASE:?error} - API_POSTGRES_HOST=${API_POSTGRES_HOST:?error} @@ -64,6 +75,7 @@ services: # https://docs.docker.com/reference/compose-file/services/#networks networks: - api + - minio - postgres # https://docs.docker.com/reference/compose-file/services/#profiles profiles: @@ -121,6 +133,44 @@ services: # - source: ./docker/admin # target: /srv # type: bind + minio: + # https://docs.docker.com/compose/environment-variables/ + # https://docs.docker.com/reference/compose-file/services/#environment + environment: + - MINIO_BROWSER=${MINIO_BROWSER:?error} + # https://min.io/docs/minio/linux/reference/minio-server/settings/root-credentials.html#envvar.MINIO_ROOT_PASSWORD + - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:?error} + # https://min.io/docs/minio/linux/reference/minio-server/settings/root-credentials.html#root-user + - MINIO_ROOT_USER=${MINIO_ROOT_USER:?error} + # https://docs.docker.com/reference/compose-file/services/#command + command: server /data --console-address ":9001" + # https://docs.docker.com/reference/dockerfile/#healthcheck + # https://docs.docker.com/reference/compose-file/services/#healthcheck + healthcheck: + interval: 10s + retries: 3 + start_interval: 1s + start_period: 5s + # https://github.com/minio/minio/issues/18373 + # https://min.io/docs/minio/linux/reference/minio-mc/mc-ready.html + test: ["CMD-SHELL", "mc ready local"] + timeout: 10s + # https://docs.docker.com/reference/compose-file/services/#image + # https://hub.docker.com/r/minio/minio + image: minio/minio:RELEASE.2024-12-18T13-15-44Z + # https://docs.docker.com/reference/compose-file/services/#networks + networks: + - minio + # https://docs.docker.com/reference/compose-file/services/#profiles + profiles: + - minio + # https://docs.docker.com/reference/compose-file/services/#restart + restart: unless-stopped + # https://docs.docker.com/reference/compose-file/services/#volumes + volumes: + - source: minio_data + target: /data + type: volume postgres: # https://docs.docker.com/compose/environment-variables/ # https://docs.docker.com/reference/compose-file/services/#environment @@ -144,7 +194,7 @@ services: timeout: 10s # https://docs.docker.com/reference/compose-file/services/#image # https://hub.docker.com/_/postgres - image: postgres:17.0-alpine3.20 + image: postgres:17.2-alpine3.21 # https://docs.docker.com/reference/compose-file/services/#networks networks: - postgres @@ -162,4 +212,5 @@ services: volumes: caddy_config: caddy_data: + minio_data: postgres_data: diff --git a/docker/compose.development.yaml b/docker/compose.development.yaml index 574ccc18993..e868dec7a2f 100644 --- a/docker/compose.development.yaml +++ b/docker/compose.development.yaml @@ -12,6 +12,9 @@ services: # https://docs.docker.com/reference/compose-file/build/#target target: devcontainer depends_on: + minio: + condition: service_healthy + required: true postgres: condition: service_healthy required: true @@ -81,7 +84,7 @@ services: timeout: 10s # https://dbeaver.com/docs/cloudbeaver/Run-Docker-Container/ # https://hub.docker.com/r/dbeaver/cloudbeaver - image: dbeaver/cloudbeaver:24.2.0 + image: dbeaver/cloudbeaver:24.3.1 # https://docs.docker.com/reference/compose-file/services/#networks networks: - postgres @@ -102,6 +105,29 @@ services: - source: cloudbeaver_data target: /opt/cloudbeaver/workspace type: volume + minio: + # https://docs.docker.com/reference/compose-file/services/#ports + ports: + - host_ip: ${MINIO_API_MAPPED_HOST_IP:?error} + name: minio_api + published: ${MINIO_API_MAPPED_PORT:?error} + target: 9000 + - host_ip: ${MINIO_CONSOLE_MAPPED_HOST_IP:?error} + name: minio_console + published: ${MINIO_CONSOLE_MAPPED_PORT:?error} + target: 9001 + # https://github.com/minio/minio/issues/13025 + minio-test: + # https://docs.docker.com/reference/compose-file/services/#ports + ports: + - host_ip: ${MINIO_TEST_API_MAPPED_HOST_IP:?error} + name: minio_api + published: ${MINIO_TEST_API_MAPPED_PORT:?error} + target: 9000 + - host_ip: ${MINIO_TEST_CONSOLE_MAPPED_HOST_IP:?error} + name: minio_console + published: ${MINIO_TEST_CONSOLE_MAPPED_PORT:?error} + target: 9001 postgres: # https://docs.docker.com/reference/compose-file/services/#ports ports: diff --git a/docker/compose.testing.yaml b/docker/compose.testing.yaml index 5fe7857883b..f49018c9022 100644 --- a/docker/compose.testing.yaml +++ b/docker/compose.testing.yaml @@ -1,5 +1,6 @@ # https://docs.docker.com/reference/compose-file/networks/ networks: + minio_test: postgres_test: # https://docs.docker.com/reference/compose-file/services services: @@ -11,6 +12,10 @@ services: command: pnpm run_tests # https://docs.docker.com/reference/compose-file/services/#depends_on depends_on: + minio-test: + condition: service_healthy + # Should be set to false when a third party minio test service could be used in the api service and the `minio_test` compose profile is disabled. + required: true postgres_test: condition: service_healthy # Should be set to false when a third party postgres test service could be used in the api service the and the `postgres_test` compose profile is disabled. @@ -18,6 +23,7 @@ services: # https://docs.docker.com/compose/environment-variables/ # https://docs.docker.com/reference/compose-file/services/#environment environment: + - API_MINIO_TEST_END_POINT=${API_MINIO_TEST_END_POINT:?error} - API_POSTGRES_TEST_HOST=${API_POSTGRES_TEST_HOST:?error} # https://docs.docker.com/reference/dockerfile/#healthcheck # https://docs.docker.com/reference/compose-file/services/#healthcheck @@ -25,9 +31,49 @@ services: disable: true # https://docs.docker.com/reference/compose-file/services/#networks networks: + - minio_test - postgres_test # https://docs.docker.com/reference/compose-file/services/#restart restart: no + # https://github.com/minio/minio/issues/13025 + minio-test: + # https://docs.docker.com/compose/environment-variables/ + # https://docs.docker.com/reference/compose-file/services/#environment + environment: + - MINIO_BROWSER=${MINIO_TEST_BROWSER:?error} + # https://min.io/docs/minio/linux/reference/minio-server/settings/root-credentials.html#envvar.MINIO_ROOT_PASSWORD + - MINIO_ROOT_PASSWORD=${MINIO_TEST_ROOT_PASSWORD:?error} + # https://min.io/docs/minio/linux/reference/minio-server/settings/root-credentials.html#root-user + - MINIO_ROOT_USER=${MINIO_TEST_ROOT_USER:?error} + # https://docs.docker.com/reference/compose-file/services/#command + command: server /data --console-address ":9001" + # https://docs.docker.com/reference/dockerfile/#healthcheck + # https://docs.docker.com/reference/compose-file/services/#healthcheck + healthcheck: + interval: 10s + retries: 3 + start_interval: 1s + start_period: 5s + # https://github.com/minio/minio/issues/18373 + # https://min.io/docs/minio/linux/reference/minio-mc/mc-ready.html + test: ["CMD-SHELL", "mc ready local"] + timeout: 10s + # https://docs.docker.com/reference/compose-file/services/#image + # https://hub.docker.com/r/minio/minio + image: minio/minio:RELEASE.2024-12-18T13-15-44Z + # https://docs.docker.com/reference/compose-file/services/#networks + networks: + - minio_test + # https://docs.docker.com/reference/compose-file/services/#profiles + profiles: + - minio_test + # https://docs.docker.com/reference/compose-file/services/#restart + restart: unless-stopped + # https://docs.docker.com/reference/compose-file/services/#volumes + volumes: + - source: minio_test_data + target: /data + type: volume postgres_test: # https://docs.docker.com/compose/environment-variables/ # https://docs.docker.com/reference/compose-file/services/#environment @@ -51,7 +97,7 @@ services: timeout: 10s # https://docs.docker.com/reference/compose-file/services/#image # https://hub.docker.com/_/postgres - image: postgres:17.0-alpine3.20 + image: postgres:17.2-alpine3.21 # https://docs.docker.com/reference/compose-file/services/#networks networks: - postgres_test @@ -67,4 +113,5 @@ services: type: volume # https://docs.docker.com/reference/compose-file/volumes/ volumes: + minio_test_data: postgres_test_data: \ No newline at end of file diff --git a/drizzle_migrations/20241226151206_massive_grey_gargoyle.sql b/drizzle_migrations/20241231123945_true_dorian_gray.sql similarity index 99% rename from drizzle_migrations/20241226151206_massive_grey_gargoyle.sql rename to drizzle_migrations/20241231123945_true_dorian_gray.sql index c405e038a9a..eda435a61e1 100644 --- a/drizzle_migrations/20241226151206_massive_grey_gargoyle.sql +++ b/drizzle_migrations/20241231123945_true_dorian_gray.sql @@ -31,10 +31,10 @@ CREATE TABLE "advertisement_attachments" ( "advertisement_id" uuid NOT NULL, "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, "creator_id" uuid, - "type" text NOT NULL, + "mime_type" text NOT NULL, + "name" text NOT NULL, "updated_at" timestamp (3) with time zone, - "updater_id" uuid, - "uri" text NOT NULL + "updater_id" uuid ); --> statement-breakpoint CREATE TABLE "advertisements" ( @@ -99,7 +99,8 @@ CREATE TABLE "chat_messages" ( ); --> statement-breakpoint CREATE TABLE "chats" ( - "avatar_uri" text, + "avatar_mime_type" text, + "avatar_name" text, "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, "creator_id" uuid, "description" text, @@ -135,10 +136,10 @@ CREATE TABLE "event_attachments" ( "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, "creator_id" uuid, "event_id" uuid NOT NULL, - "type" text NOT NULL, + "mime_type" text NOT NULL, + "name" text NOT NULL, "updated_at" timestamp (3) with time zone, - "updater_id" uuid, - "uri" text NOT NULL + "updater_id" uuid ); --> statement-breakpoint CREATE TABLE "event_attendances" ( @@ -236,7 +237,8 @@ CREATE TABLE "organization_memberships" ( --> statement-breakpoint CREATE TABLE "organizations" ( "address" text, - "avatar_uri" text, + "avatar_mime_type" text, + "avatar_name" text, "city" text, "country_code" text, "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, @@ -255,10 +257,10 @@ CREATE TABLE "post_attachments" ( "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, "creator_id" uuid, "post_id" uuid NOT NULL, - "type" text NOT NULL, + "mime_type" text NOT NULL, + "name" text NOT NULL, "updated_at" timestamp (3) with time zone, - "updater_id" uuid, - "uri" text NOT NULL + "updater_id" uuid ); --> statement-breakpoint CREATE TABLE "post_votes" ( @@ -314,7 +316,8 @@ CREATE TABLE "tags" ( --> statement-breakpoint CREATE TABLE "users" ( "address" text, - "avatar_uri" text, + "avatar_mime_type" text, + "avatar_name" text, "birth_date" date, "city" text, "country_code" text, @@ -344,10 +347,10 @@ CREATE TABLE "users" ( CREATE TABLE "venue_attachments" ( "created_at" timestamp (3) with time zone DEFAULT now() NOT NULL, "creator_id" uuid, - "type" text NOT NULL, + "mime_type" text NOT NULL, + "name" text NOT NULL, "updated_at" timestamp (3) with time zone, "updater_id" uuid, - "uri" text NOT NULL, "venue_id" uuid NOT NULL ); --> statement-breakpoint diff --git a/drizzle_migrations/meta/20241226151206_snapshot.json b/drizzle_migrations/meta/20241231123945_snapshot.json similarity index 99% rename from drizzle_migrations/meta/20241226151206_snapshot.json rename to drizzle_migrations/meta/20241231123945_snapshot.json index 741e4dbb6ea..789d83031d3 100644 --- a/drizzle_migrations/meta/20241226151206_snapshot.json +++ b/drizzle_migrations/meta/20241231123945_snapshot.json @@ -1,5 +1,5 @@ { - "id": "e0fa5b89-21dc-4ac2-87f0-3b7b62f49312", + "id": "62950bfb-fb43-4883-a2df-9dcc9aaf1687", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -485,8 +485,14 @@ "primaryKey": false, "notNull": false }, - "type": { - "name": "type", + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", "type": "text", "primaryKey": false, "notNull": true @@ -502,12 +508,6 @@ "type": "uuid", "primaryKey": false, "notNull": false - }, - "uri": { - "name": "uri", - "type": "text", - "primaryKey": false, - "notNull": true } }, "indexes": { @@ -1583,8 +1583,14 @@ "name": "chats", "schema": "", "columns": { - "avatar_uri": { - "name": "avatar_uri", + "avatar_mime_type": { + "name": "avatar_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_name": { + "name": "avatar_name", "type": "text", "primaryKey": false, "notNull": false @@ -2084,8 +2090,14 @@ "primaryKey": false, "notNull": true }, - "type": { - "name": "type", + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", "type": "text", "primaryKey": false, "notNull": true @@ -2101,12 +2113,6 @@ "type": "uuid", "primaryKey": false, "notNull": false - }, - "uri": { - "name": "uri", - "type": "text", - "primaryKey": false, - "notNull": true } }, "indexes": { @@ -3792,8 +3798,14 @@ "primaryKey": false, "notNull": false }, - "avatar_uri": { - "name": "avatar_uri", + "avatar_mime_type": { + "name": "avatar_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_name": { + "name": "avatar_name", "type": "text", "primaryKey": false, "notNull": false @@ -3978,8 +3990,14 @@ "primaryKey": false, "notNull": true }, - "type": { - "name": "type", + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", "type": "text", "primaryKey": false, "notNull": true @@ -3995,12 +4013,6 @@ "type": "uuid", "primaryKey": false, "notNull": false - }, - "uri": { - "name": "uri", - "type": "text", - "primaryKey": false, - "notNull": true } }, "indexes": { @@ -4953,8 +4965,14 @@ "primaryKey": false, "notNull": false }, - "avatar_uri": { - "name": "avatar_uri", + "avatar_mime_type": { + "name": "avatar_mime_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "avatar_name": { + "name": "avatar_name", "type": "text", "primaryKey": false, "notNull": false @@ -5205,8 +5223,14 @@ "primaryKey": false, "notNull": false }, - "type": { - "name": "type", + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", "type": "text", "primaryKey": false, "notNull": true @@ -5223,12 +5247,6 @@ "primaryKey": false, "notNull": false }, - "uri": { - "name": "uri", - "type": "text", - "primaryKey": false, - "notNull": true - }, "venue_id": { "name": "venue_id", "type": "uuid", diff --git a/drizzle_migrations/meta/_journal.json b/drizzle_migrations/meta/_journal.json index 3ec6120c9af..c6465c642a0 100644 --- a/drizzle_migrations/meta/_journal.json +++ b/drizzle_migrations/meta/_journal.json @@ -5,8 +5,8 @@ { "idx": 0, "version": "7", - "when": 1735225926844, - "tag": "20241226151206_massive_grey_gargoyle", + "when": 1735648785424, + "tag": "20241231123945_true_dorian_gray", "breakpoints": true } ] diff --git a/envFiles/.env.ci b/envFiles/.env.ci index 5b83fdcab94..c75019e7355 100644 --- a/envFiles/.env.ci +++ b/envFiles/.env.ci @@ -2,6 +2,7 @@ API_ADMINISTRATOR_USER_EMAIL_ADDRESS=administrator@email.com API_ADMINISTRATOR_USER_PASSWORD=password +API_BASE_URL=http://127.0.0.1:8080 API_HOST=0.0.0.0 API_IS_APPLY_DRIZZLE_MIGRATIONS=true API_IS_GRAPHIQL=false @@ -9,6 +10,12 @@ API_IS_PINO_PRETTY=false API_JWT_EXPIRES_IN=2592000000 API_JWT_SECRET=b4896453be722d5ca94058a73f52b31c75980b485fa6d74d91f417a8059d8731 API_LOG_LEVEL=info +API_MINIO_ACCESS_KEY=talawa +API_MINIO_END_POINT=minio +API_MINIO_PORT=9000 +API_MINIO_SECRET_KEY=password +API_MINIO_TEST_END_POINT=minio-test +API_MINIO_USE_SSL=false API_PORT=8080 API_POSTGRES_DATABASE=talawa API_POSTGRES_HOST=postgres @@ -27,6 +34,18 @@ NODE_ENV=production API_GID=1000 API_UID=1000 +########## docker compose `minio` container service ########## + +MINIO_BROWSER=off +MINIO_ROOT_PASSWORD=password +MINIO_ROOT_USER=talawa + +########## docker compose `minio-test` container service ########## + +MINIO_TEST_BROWSER=off +MINIO_TEST_ROOT_PASSWORD=password +MINIO_TEST_ROOT_USER=talawa + ########## docker compose `caddy` container service ########## CADDY_HTTP_MAPPED_PORT=80 @@ -52,5 +71,5 @@ POSTGRES_TEST_USER=talawa ########## docker compose ########## COMPOSE_FILE=./compose.yaml:./docker/compose.testing.yaml -COMPOSE_PROFILES=api,postgres_test +COMPOSE_PROFILES=api,minio_test,postgres_test COMPOSE_PROJECT_NAME=talawa diff --git a/envFiles/.env.development b/envFiles/.env.development index 5b946a25515..ee24abb7f74 100644 --- a/envFiles/.env.development +++ b/envFiles/.env.development @@ -2,6 +2,7 @@ API_ADMINISTRATOR_USER_EMAIL_ADDRESS=administrator@email.com API_ADMINISTRATOR_USER_PASSWORD=password +API_BASE_URL=http://127.0.0.1:8080 API_DEBUGGER_HOST=0.0.0.0 API_DEBUGGER_PORT=9229 API_HOST=0.0.0.0 @@ -11,6 +12,12 @@ API_IS_PINO_PRETTY=true API_JWT_EXPIRES_IN=2592000000 API_JWT_SECRET=b4896453be722d5ca94058a73f52b31c75980b485fa6d74d91f417a8059d8731 API_LOG_LEVEL=debug +API_MINIO_ACCESS_KEY=talawa +API_MINIO_END_POINT=minio +API_MINIO_PORT=9000 +API_MINIO_SECRET_KEY=password +API_MINIO_TEST_END_POINT=minio-test +API_MINIO_USE_SSL=false API_PORT=8080 API_POSTGRES_DATABASE=talawa API_POSTGRES_HOST=postgres @@ -52,6 +59,26 @@ CLOUDBEAVER_MAPPED_PORT=8978 CLOUDBEAVER_SERVER_NAME=Talawa CloudBeaver Server CLOUDBEAVER_SERVER_URL=http://127.0.0.1:8978 +########## docker compose `minio` container service ########## + +MINIO_BROWSER=on +MINIO_API_MAPPED_HOST_IP=127.0.0.1 +MINIO_API_MAPPED_PORT=9000 +MINIO_CONSOLE_MAPPED_HOST_IP=127.0.0.1 +MINIO_CONSOLE_MAPPED_PORT=9001 +MINIO_ROOT_PASSWORD=password +MINIO_ROOT_USER=talawa + +########## docker compose `minio-test` container service ########## + +MINIO_TEST_BROWSER=on +MINIO_TEST_API_MAPPED_HOST_IP=127.0.0.1 +MINIO_TEST_API_MAPPED_PORT=9002 +MINIO_TEST_CONSOLE_MAPPED_HOST_IP=127.0.0.1 +MINIO_TEST_CONSOLE_MAPPED_PORT=9003 +MINIO_TEST_ROOT_PASSWORD=password +MINIO_TEST_ROOT_USER=talawa + ########## docker compose `postgres` container service ########## POSTGRES_DB=talawa @@ -71,5 +98,5 @@ POSTGRES_TEST_USER=talawa ########## docker compose ########## COMPOSE_FILE=./compose.yaml:./docker/compose.testing.yaml:./docker/compose.development.yaml -COMPOSE_PROFILES=api,caddy,cloudbeaver,postgres,postgres_test +COMPOSE_PROFILES=api,caddy,cloudbeaver,minio,minio_test,postgres,postgres_test COMPOSE_PROJECT_NAME=talawa diff --git a/envFiles/.env.production b/envFiles/.env.production index 22978df3b5b..14b6448b327 100644 --- a/envFiles/.env.production +++ b/envFiles/.env.production @@ -2,6 +2,7 @@ API_ADMINISTRATOR_USER_EMAIL_ADDRESS=administrator@email.com API_ADMINISTRATOR_USER_PASSWORD=password +API_BASE_URL= API_HOST=0.0.0.0 API_IS_APPLY_DRIZZLE_MIGRATIONS=true API_IS_GRAPHIQL=false @@ -9,6 +10,11 @@ API_IS_PINO_PRETTY=false API_JWT_EXPIRES_IN=2592000000 API_JWT_SECRET= API_LOG_LEVEL=info +API_MINIO_ACCESS_KEY=talawa +API_MINIO_END_POINT=minio +API_MINIO_PORT=9000 +API_MINIO_SECRET_KEY=password +API_MINIO_USE_SSL=false API_PORT=8080 API_POSTGRES_DATABASE=talawa API_POSTGRES_HOST=postgres @@ -35,6 +41,12 @@ CADDY_TALAWA_API_EMAIL= CADDY_TALAWA_API_HOST=api CADDY_TALAWA_API_PORT=8080 +########## docker compose `minio` container service ########## + +MINIO_BROWSER=off +MINIO_ROOT_PASSWORD=password +MINIO_ROOT_USER=talawa + ########## docker compose `postgres` container service ########## POSTGRES_DB=talawa @@ -44,5 +56,5 @@ POSTGRES_USER=talawa ########## docker compose ########## COMPOSE_FILE=./compose.yaml -COMPOSE_PROFILES=api,caddy,postgres +COMPOSE_PROFILES=api,caddy,minio,postgres COMPOSE_PROJECT_NAME=talawa diff --git a/package.json b/package.json index 700c32ae241..078214dec96 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,12 @@ "fastify-plugin": "^5.0.1", "graphql": "^16.10.0", "graphql-scalars": "^1.24.0", + "graphql-upload-minimal": "^1.6.1", "mercurius": "^16.0.0", + "mercurius-upload": "^8.0.0", + "minio": "^8.0.3", "postgres": "^3.4.5", + "ulidx": "^2.4.1", "uuidv7": "^1.0.2", "zod": "^3.24.1" }, @@ -32,13 +36,13 @@ "@biomejs/biome": "^1.9.4", "@faker-js/faker": "^9.3.0", "@swc/cli": "0.5.2", - "@swc/core": "^1.10.1", + "@swc/core": "^1.10.4", "@types/node": "^22.10.2", "@vitest/coverage-v8": "^2.1.8", "drizzle-kit": "^0.30.1", "gql.tada": "^1.8.10", "lefthook": "^1.10.1", - "mercurius-integration-testing": "^9.0.0", + "mercurius-integration-testing": "^9.0.1", "pino-pretty": "^13.0.0", "tsx": "^4.19.2", "typescript": "^5.7.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b412f2d2b63..67df2bb6e14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,12 +62,24 @@ importers: graphql-scalars: specifier: ^1.24.0 version: 1.24.0(graphql@16.10.0) + graphql-upload-minimal: + specifier: ^1.6.1 + version: 1.6.1(graphql@16.10.0) mercurius: specifier: ^16.0.0 version: 16.0.0(graphql@16.10.0) + mercurius-upload: + specifier: ^8.0.0 + version: 8.0.0(graphql@16.10.0) + minio: + specifier: ^8.0.3 + version: 8.0.3 postgres: specifier: ^3.4.5 version: 3.4.5 + ulidx: + specifier: ^2.4.1 + version: 2.4.1 uuidv7: specifier: ^1.0.2 version: 1.0.2 @@ -83,10 +95,10 @@ importers: version: 9.3.0 '@swc/cli': specifier: 0.5.2 - version: 0.5.2(@swc/core@1.10.1) + version: 0.5.2(@swc/core@1.10.4) '@swc/core': - specifier: ^1.10.1 - version: 1.10.1 + specifier: ^1.10.4 + version: 1.10.4 '@types/node': specifier: ^22.10.2 version: 22.10.2 @@ -103,8 +115,8 @@ importers: specifier: ^1.10.1 version: 1.10.1 mercurius-integration-testing: - specifier: ^9.0.0 - version: 9.0.0(fastify@5.2.0)(graphql@16.10.0)(mercurius@16.0.0(graphql@16.10.0)) + specifier: ^9.0.1 + version: 9.0.1(fastify@5.2.0)(graphql@16.10.0)(mercurius@16.0.0(graphql@16.10.0)) pino-pretty: specifier: ^13.0.0 version: 13.0.0 @@ -1219,68 +1231,68 @@ packages: chokidar: optional: true - '@swc/core-darwin-arm64@1.10.1': - resolution: {integrity: sha512-NyELPp8EsVZtxH/mEqvzSyWpfPJ1lugpTQcSlMduZLj1EASLO4sC8wt8hmL1aizRlsbjCX+r0PyL+l0xQ64/6Q==} + '@swc/core-darwin-arm64@1.10.4': + resolution: {integrity: sha512-sV/eurLhkjn/197y48bxKP19oqcLydSel42Qsy2zepBltqUx+/zZ8+/IS0Bi7kaWVFxerbW1IPB09uq8Zuvm3g==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.10.1': - resolution: {integrity: sha512-L4BNt1fdQ5ZZhAk5qoDfUnXRabDOXKnXBxMDJ+PWLSxOGBbWE6aJTnu4zbGjJvtot0KM46m2LPAPY8ttknqaZA==} + '@swc/core-darwin-x64@1.10.4': + resolution: {integrity: sha512-gjYNU6vrAUO4+FuovEo9ofnVosTFXkF0VDuo1MKPItz6e2pxc2ale4FGzLw0Nf7JB1sX4a8h06CN16/pLJ8Q2w==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.10.1': - resolution: {integrity: sha512-Y1u9OqCHgvVp2tYQAJ7hcU9qO5brDMIrA5R31rwWQIAKDkJKtv3IlTHF0hrbWk1wPR0ZdngkQSJZple7G+Grvw==} + '@swc/core-linux-arm-gnueabihf@1.10.4': + resolution: {integrity: sha512-zd7fXH5w8s+Sfvn2oO464KDWl+ZX1MJiVmE4Pdk46N3PEaNwE0koTfgx2vQRqRG4vBBobzVvzICC3618WcefOA==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.10.1': - resolution: {integrity: sha512-tNQHO/UKdtnqjc7o04iRXng1wTUXPgVd8Y6LI4qIbHVoVPwksZydISjMcilKNLKIwOoUQAkxyJ16SlOAeADzhQ==} + '@swc/core-linux-arm64-gnu@1.10.4': + resolution: {integrity: sha512-+UGfoHDxsMZgFD3tABKLeEZHqLNOkxStu+qCG7atGBhS4Slri6h6zijVvf4yI5X3kbXdvc44XV/hrP/Klnui2A==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.10.1': - resolution: {integrity: sha512-x0L2Pd9weQ6n8dI1z1Isq00VHFvpBClwQJvrt3NHzmR+1wCT/gcYl1tp9P5xHh3ldM8Cn4UjWCw+7PaUgg8FcQ==} + '@swc/core-linux-arm64-musl@1.10.4': + resolution: {integrity: sha512-cDDj2/uYsOH0pgAnDkovLZvKJpFmBMyXkxEG6Q4yw99HbzO6QzZ5HDGWGWVq/6dLgYKlnnmpjZCPPQIu01mXEg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.10.1': - resolution: {integrity: sha512-yyYEwQcObV3AUsC79rSzN9z6kiWxKAVJ6Ntwq2N9YoZqSPYph+4/Am5fM1xEQYf/kb99csj0FgOelomJSobxQA==} + '@swc/core-linux-x64-gnu@1.10.4': + resolution: {integrity: sha512-qJXh9D6Kf5xSdGWPINpLGixAbB5JX8JcbEJpRamhlDBoOcQC79dYfOMEIxWPhTS1DGLyFakAx2FX/b2VmQmj0g==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.10.1': - resolution: {integrity: sha512-tcaS43Ydd7Fk7sW5ROpaf2Kq1zR+sI5K0RM+0qYLYYurvsJruj3GhBCaiN3gkzd8m/8wkqNqtVklWaQYSDsyqA==} + '@swc/core-linux-x64-musl@1.10.4': + resolution: {integrity: sha512-A76lIAeyQnHCVt0RL/pG+0er8Qk9+acGJqSZOZm67Ve3B0oqMd871kPtaHBM0BW3OZAhoILgfHW3Op9Q3mx3Cw==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.10.1': - resolution: {integrity: sha512-D3Qo1voA7AkbOzQ2UGuKNHfYGKL6eejN8VWOoQYtGHHQi1p5KK/Q7V1ku55oxXBsj79Ny5FRMqiRJpVGad7bjQ==} + '@swc/core-win32-arm64-msvc@1.10.4': + resolution: {integrity: sha512-e6j5kBu4fIY7fFxFxnZI0MlEovRvp50Lg59Fw+DVbtqHk3C85dckcy5xKP+UoXeuEmFceauQDczUcGs19SRGSQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.10.1': - resolution: {integrity: sha512-WalYdFoU3454Og+sDKHM1MrjvxUGwA2oralknXkXL8S0I/8RkWZOB++p3pLaGbTvOO++T+6znFbQdR8KRaa7DA==} + '@swc/core-win32-ia32-msvc@1.10.4': + resolution: {integrity: sha512-RSYHfdKgNXV/amY5Tqk1EWVsyQnhlsM//jeqMLw5Fy9rfxP592W9UTumNikNRPdjI8wKKzNMXDb1U29tQjN0dg==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.10.1': - resolution: {integrity: sha512-JWobfQDbTnoqaIwPKQ3DVSywihVXlQMbDuwik/dDWlj33A8oEHcjPOGs4OqcA3RHv24i+lfCQpM3Mn4FAMfacA==} + '@swc/core-win32-x64-msvc@1.10.4': + resolution: {integrity: sha512-1ujYpaqfqNPYdwKBlvJnOqcl+Syn3UrQ4XE0Txz6zMYgyh6cdU6a3pxqLqIUSJ12MtXRA9ZUhEz1ekU3LfLWXw==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.10.1': - resolution: {integrity: sha512-rQ4dS6GAdmtzKiCRt3LFVxl37FaY1cgL9kSUTnhQ2xc3fmHOd7jdJK/V4pSZMG1ruGTd0bsi34O2R0Olg9Zo/w==} + '@swc/core@1.10.4': + resolution: {integrity: sha512-ut3zfiTLORMxhr6y/GBxkHmzcGuVpwJYX4qyXWuBKkpw/0g0S5iO1/wW7RnLnZbAi8wS/n0atRZoaZlXWBkeJg==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -1391,6 +1403,9 @@ packages: resolution: {integrity: sha512-siPY6BD5dQ2SZPl3I0OZBHL27ZqZvLEosObsZRQ1NUB8qcxegwt0T9eKtV96JMFQpIz1elhkzqOg4c/Ri6Dp9A==} engines: {node: ^14.14.0 || >=16.0.0} + '@zxing/text-encoding@0.9.0': + resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} + abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -1439,10 +1454,17 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + atomic-sleep@1.0.0: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} + available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + avvio@9.1.0: resolution: {integrity: sha512-fYASnYi600CsH/j9EQov7lECAniYiBFiiAtBNuZYLA2leLe9qOvZzqYHFjtIj6gD2VMoMLP14834LFWvr4IfDw==} @@ -1466,6 +1488,9 @@ packages: resolution: {integrity: sha512-nk5wEsP4RiKjG+vF+uG8lFsEn4d7Y6FVDamzzftSunXOoOcOOkzcWdKVlGgFFwlUQCj63SgnUkLLGF8v7lufhw==} engines: {node: '>=12'} + block-stream2@2.1.0: + resolution: {integrity: sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg==} + bn.js@4.12.1: resolution: {integrity: sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==} @@ -1476,9 +1501,16 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + browser-or-node@2.1.1: + resolution: {integrity: sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==} + buffer-crc32@0.2.13: resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} + buffer-crc32@1.0.0: + resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} + engines: {node: '>=8.0.0'} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -1488,6 +1520,10 @@ packages: buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + busboy@1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -1500,6 +1536,18 @@ packages: resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} engines: {node: '>=14.16'} + call-bind-apply-helpers@1.0.1: + resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==} + engines: {node: '>= 0.4'} + + call-bind@1.0.8: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + call-bound@1.0.3: + resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==} + engines: {node: '>= 0.4'} + chai@5.1.2: resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} @@ -1537,10 +1585,6 @@ packages: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} - cookie@0.5.0: - resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} - engines: {node: '>= 0.6'} - cookie@1.0.2: resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} engines: {node: '>=18'} @@ -1561,6 +1605,10 @@ packages: supports-color: optional: true + decode-uri-component@0.2.2: + resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} + engines: {node: '>=0.10'} + decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -1577,6 +1625,10 @@ packages: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} + define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} @@ -1691,6 +1743,10 @@ packages: drizzle-orm: '>=0.23.13' zod: '*' + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + duplexify@4.1.3: resolution: {integrity: sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==} @@ -1712,8 +1768,20 @@ packages: env-schema@6.0.0: resolution: {integrity: sha512-/IHp1EmrfubUOfF1wfe8koDWM5/dxUDylHANPNrPyrsYWJ7KRiB8gXbjtqQBujmOhpSpXXOhhnaL+meb+MaGtA==} - es-module-lexer@1.5.4: - resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-module-lexer@1.6.0: + resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} + + es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} esbuild-register@3.6.0: resolution: {integrity: sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg==} @@ -1750,6 +1818,9 @@ packages: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -1812,6 +1883,10 @@ packages: fast-uri@3.0.3: resolution: {integrity: sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==} + fast-xml-parser@4.5.1: + resolution: {integrity: sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==} + hasBin: true + fastfall@1.5.1: resolution: {integrity: sha512-KH6p+Z8AKPXnmA7+Iz2Lh8ARCMr+8WNPVludm1LGkZoD2MjY6LVnRMtTKhkdzI+jr0RzQWXKzKyBJm1zoHEL4Q==} engines: {node: '>=0.10.0'} @@ -1847,6 +1922,10 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + filter-obj@1.1.0: + resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} + engines: {node: '>=0.10.0'} + find-my-way@9.1.0: resolution: {integrity: sha512-Y5jIsuYR4BwWDYYQ2A/RWWE6gD8a0FMgtU+HOq1WKku+Cwdz8M1v8wcAmRXXM1/iqtoqg06v+LjAxMYbCjViMw==} engines: {node: '>=14'} @@ -1855,6 +1934,9 @@ packages: resolution: {integrity: sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==} engines: {node: '>=12'} + for-each@0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + foreground-child@3.3.0: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} @@ -1872,9 +1954,16 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + generate-function@2.3.1: resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} + get-intrinsic@1.2.6: + resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} + engines: {node: '>= 0.4'} + get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -1902,6 +1991,10 @@ packages: globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + got@13.0.0: resolution: {integrity: sha512-XfBk1CxOOScDcMr9O1yKkNaQyy865NbYs+F7dr4H0LZMVgCj2Le59k6PqbNHoL5ToeaEQUYh6c6yMfVcc6SJxA==} engines: {node: '>=16'} @@ -1926,6 +2019,12 @@ packages: peerDependencies: graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + graphql-upload-minimal@1.6.1: + resolution: {integrity: sha512-wNUf/KqA0B/OguL1k6qWa4AmAduLUAhXzovh9i14SKbpBa8HX2vc7f+fR67S0rG7fSpGdM/aivxzC329/+9xXw==} + engines: {node: '>=12'} + peerDependencies: + graphql: 0.13.1 - 16 + graphql@16.10.0: resolution: {integrity: sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} @@ -1934,6 +2033,21 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + helmet@8.0.0: resolution: {integrity: sha512-VyusHLEIIO5mjQPUI1wpOAEu+wl6Q0998jzTxqUYGE45xCIcAxy3MsbEK/yyJUJ3ADeMoB6MornPH6GMWAf+Pw==} engines: {node: '>=18.0.0'} @@ -1976,6 +2090,18 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} + ipaddr.js@2.2.0: + resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} + engines: {node: '>= 10'} + + is-arguments@1.2.0: + resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} + engines: {node: '>= 0.4'} + + is-callable@1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -1984,6 +2110,10 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-generator-function@1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2007,6 +2137,10 @@ packages: resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} engines: {node: '>=18'} + is-typed-array@1.1.15: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2053,6 +2187,9 @@ packages: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} + layerr@3.0.0: + resolution: {integrity: sha512-tv754Ki2dXpPVApOrjTyRo4/QegVb9eVFq4mjqp4+NM5NaX7syQvN5BBNfV/ZpAHCEHV24XdUVrBAoka4jt3pA==} + lefthook-darwin-arm64@1.10.1: resolution: {integrity: sha512-dGi4Oiu2LSve8Xmz7vHWlUbnU5mk6HnhTbC1CnXqaFbb08yNYSYoJBwsalS+LoO4L6I/pqnv32ESCbdIzuhBiQ==} cpu: [arm64] @@ -2119,6 +2256,9 @@ packages: lodash.mergewith@4.6.2: resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -2143,21 +2283,30 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} - mercurius-integration-testing@9.0.0: - resolution: {integrity: sha512-N2GRMPOZ2BjgnTUH3QKcv9INd3AXb7u7GYQQ8EeakBTqZ68PkWppM32RwNTRMKuxJblUBbTEOJ5diAwo0ETP9A==} + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + mercurius-integration-testing@9.0.1: + resolution: {integrity: sha512-AAE0slhjNPtNbRD3guczsEzlh38ClzFlvU/VnuMHqjWUDsc7pHkk8psFTxlJ6ihFiNIVBBPDIfWnBzbMJ+7IrA==} engines: {node: '>=14'} peerDependencies: '@mercuriusjs/federation': ^1 || ^2 '@mercuriusjs/gateway': ^1.2.0 fastify: ^4.0.0 || ^5.0.0 graphql: '*' - mercurius: ^12 || ^13 || ^14 || ^15 + mercurius: ^12 || ^13 || ^14 || ^15 || ^16 peerDependenciesMeta: '@mercuriusjs/federation': optional: true '@mercuriusjs/gateway': optional: true + mercurius-upload@8.0.0: + resolution: {integrity: sha512-lKYtqo6enNHRhFa6MrGE2OLf5/G0CvaXLCFp/Wczb6vS14LxtWor1fPwayNbiHV3RCS9DsiMnqCWdWaySZxKWA==} + peerDependencies: + graphql: ^16.3.0 + mercurius@16.0.0: resolution: {integrity: sha512-kuxpvYmIYFGwNkdKjWQorHpKRN9rFx4b55BP2H0NImaKdHc3rmv+8MHQOrTsksk/mwm72Rl74itCAUzdBwjUAQ==} engines: {node: ^20.9.0 || >=22.0.0} @@ -2175,10 +2324,18 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + mime-db@1.53.0: resolution: {integrity: sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==} engines: {node: '>= 0.6'} + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + mime@3.0.0: resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==} engines: {node: '>=10.0.0'} @@ -2210,6 +2367,10 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + minio@8.0.3: + resolution: {integrity: sha512-+FIYQ+HZ5GrBjEmIYienRgEikqaTWAflXIV5lJOtUzfYxn3NvjQx7BsJSORXExlqgzWxKTWsqkyk2wiyFjs9/w==} + engines: {node: ^16 || ^18 || >=20} + minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} @@ -2312,6 +2473,10 @@ packages: piscina@4.8.0: resolution: {integrity: sha512-EZJb+ZxDrQf3dihsUL7p42pjNyrNIFJCrRHPMgxu/svsj+P3xS3fuEWp7k2+rfsavfl1N0G29b1HGs7J0m8rZA==} + possible-typed-array-names@1.0.0: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + postcss@8.4.49: resolution: {integrity: sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==} engines: {node: ^10 || ^12 || >=14} @@ -2338,6 +2503,10 @@ packages: resolution: {integrity: sha512-O+Wd1chXj5YE1DwmD+ae0bXiSLehmnS3czlC1R9FL/Nt/3q8uMS1bIHmg2lJfCoiimCxClWM8AAuJrF0EvNiog==} engines: {node: '>= 16'} + query-string@7.1.3: + resolution: {integrity: sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==} + engines: {node: '>=6'} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2403,8 +2572,8 @@ packages: safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-regex2@4.0.0: - resolution: {integrity: sha512-Hvjfv25jPDVr3U+4LDzBuZPPOymELG3PYcSk5hcevooo1yxxamQL/bHs/GrEPGmMoMEwRrHVGiCA1pXi97B8Ew==} + safe-regex2@4.0.1: + resolution: {integrity: sha512-goqsB+bSlOmVX+CiFX2PFc1OV88j5jvBqIM+DgqrucHnUguAUNtiNOs+aTadq2NqsLQ+TQ3UEVG3gtSFcdlkCg==} safe-stable-stringify@2.5.0: resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==} @@ -2413,6 +2582,9 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + sax@1.4.1: + resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} + secure-json-parse@2.7.0: resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} @@ -2439,6 +2611,10 @@ packages: set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} + set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} @@ -2493,6 +2669,10 @@ packages: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} engines: {node: '>= 8'} + split-on-first@1.1.0: + resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} + engines: {node: '>=6'} + split2@4.2.0: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} @@ -2510,12 +2690,26 @@ packages: steed@1.1.3: resolution: {integrity: sha512-EUkci0FAUiE4IvGTSKcDJIQ/eRUP2JJb56+fvZ4sdnguLTqIdKjSxUe138poW8mkvKWXW2sFPrgTsxqoISnmoA==} + stream-chain@2.2.5: + resolution: {integrity: sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==} + + stream-json@1.9.1: + resolution: {integrity: sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==} + stream-shift@1.0.3: resolution: {integrity: sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==} + streamsearch@1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + streamx@2.21.1: resolution: {integrity: sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==} + strict-uri-encode@2.0.0: + resolution: {integrity: sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==} + engines: {node: '>=4'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -2546,6 +2740,9 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + strnum@1.0.5: + resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} + strtok3@9.1.1: resolution: {integrity: sha512-FhwotcEqjr241ZbjFzjlIYg6c5/L/s4yBGWSMvJ9UoExiSqL+FnFA/CaeZx17WGaZMS/4SOZp8wH18jSS4R4lw==} engines: {node: '>=16'} @@ -2567,6 +2764,9 @@ packages: thread-stream@3.1.0: resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} + through2@4.0.2: + resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} + through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -2577,8 +2777,8 @@ packages: tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@0.3.1: - resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} tinypool@1.0.2: resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} @@ -2635,6 +2835,10 @@ packages: resolution: {integrity: sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==} engines: {node: '>=18'} + ulidx@2.4.1: + resolution: {integrity: sha512-xY7c8LPyzvhvew0Fn+Ek3wBC9STZAuDI/Y5andCKi9AX6/jvfaX45PhsDX8oxgPL0YFp0Jhr8qWMbS/p9375Xg==} + engines: {node: '>=16'} + unbzip2-stream@1.4.3: resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==} @@ -2644,6 +2848,9 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + util@0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + uuidv7@1.0.2: resolution: {integrity: sha512-8JQkH4ooXnm1JCIhqTMbtmdnYEn6oKukBxHn1Ic9878jMkL7daTI7anTExfY18VRCX7tcdn5quzvCb6EWrR8PA==} hasBin: true @@ -2717,6 +2924,13 @@ packages: jsdom: optional: true + web-encoding@1.1.5: + resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==} + + which-typed-array@1.1.18: + resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==} + engines: {node: '>= 0.4'} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -2750,6 +2964,14 @@ packages: utf-8-validate: optional: true + xml2js@0.6.2: + resolution: {integrity: sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==} + engines: {node: '>=4.0.0'} + + xmlbuilder@11.0.1: + resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} + engines: {node: '>=4.0'} + xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} @@ -3476,9 +3698,9 @@ snapshots: '@sindresorhus/is@5.6.0': {} - '@swc/cli@0.5.2(@swc/core@1.10.1)': + '@swc/cli@0.5.2(@swc/core@1.10.4)': dependencies: - '@swc/core': 1.10.1 + '@swc/core': 1.10.4 '@swc/counter': 0.1.3 '@xhmikosr/bin-wrapper': 13.0.5 commander: 8.3.0 @@ -3489,51 +3711,51 @@ snapshots: slash: 3.0.0 source-map: 0.7.4 - '@swc/core-darwin-arm64@1.10.1': + '@swc/core-darwin-arm64@1.10.4': optional: true - '@swc/core-darwin-x64@1.10.1': + '@swc/core-darwin-x64@1.10.4': optional: true - '@swc/core-linux-arm-gnueabihf@1.10.1': + '@swc/core-linux-arm-gnueabihf@1.10.4': optional: true - '@swc/core-linux-arm64-gnu@1.10.1': + '@swc/core-linux-arm64-gnu@1.10.4': optional: true - '@swc/core-linux-arm64-musl@1.10.1': + '@swc/core-linux-arm64-musl@1.10.4': optional: true - '@swc/core-linux-x64-gnu@1.10.1': + '@swc/core-linux-x64-gnu@1.10.4': optional: true - '@swc/core-linux-x64-musl@1.10.1': + '@swc/core-linux-x64-musl@1.10.4': optional: true - '@swc/core-win32-arm64-msvc@1.10.1': + '@swc/core-win32-arm64-msvc@1.10.4': optional: true - '@swc/core-win32-ia32-msvc@1.10.1': + '@swc/core-win32-ia32-msvc@1.10.4': optional: true - '@swc/core-win32-x64-msvc@1.10.1': + '@swc/core-win32-x64-msvc@1.10.4': optional: true - '@swc/core@1.10.1': + '@swc/core@1.10.4': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.17 optionalDependencies: - '@swc/core-darwin-arm64': 1.10.1 - '@swc/core-darwin-x64': 1.10.1 - '@swc/core-linux-arm-gnueabihf': 1.10.1 - '@swc/core-linux-arm64-gnu': 1.10.1 - '@swc/core-linux-arm64-musl': 1.10.1 - '@swc/core-linux-x64-gnu': 1.10.1 - '@swc/core-linux-x64-musl': 1.10.1 - '@swc/core-win32-arm64-msvc': 1.10.1 - '@swc/core-win32-ia32-msvc': 1.10.1 - '@swc/core-win32-x64-msvc': 1.10.1 + '@swc/core-darwin-arm64': 1.10.4 + '@swc/core-darwin-x64': 1.10.4 + '@swc/core-linux-arm-gnueabihf': 1.10.4 + '@swc/core-linux-arm64-gnu': 1.10.4 + '@swc/core-linux-arm64-musl': 1.10.4 + '@swc/core-linux-x64-gnu': 1.10.4 + '@swc/core-linux-x64-musl': 1.10.4 + '@swc/core-win32-arm64-msvc': 1.10.4 + '@swc/core-win32-ia32-msvc': 1.10.4 + '@swc/core-win32-x64-msvc': 1.10.4 '@swc/counter@0.1.3': {} @@ -3686,6 +3908,9 @@ snapshots: dependencies: arch: 3.0.0 + '@zxing/text-encoding@0.9.0': + optional: true + abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 @@ -3729,8 +3954,14 @@ snapshots: assertion-error@2.0.1: {} + async@3.2.6: {} + atomic-sleep@1.0.0: {} + available-typed-arrays@1.0.7: + dependencies: + possible-typed-array-names: 1.0.0 + avvio@9.1.0: dependencies: '@fastify/error': 4.0.0 @@ -3756,6 +3987,10 @@ snapshots: execa: 5.1.1 find-versions: 5.1.0 + block-stream2@2.1.0: + dependencies: + readable-stream: 3.6.2 + bn.js@4.12.1: {} brace-expansion@2.0.1: @@ -3766,8 +4001,12 @@ snapshots: dependencies: fill-range: 7.1.1 + browser-or-node@2.1.1: {} + buffer-crc32@0.2.13: {} + buffer-crc32@1.0.0: {} + buffer-from@1.1.2: {} buffer@5.7.1: @@ -3780,6 +4019,10 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + busboy@1.6.0: + dependencies: + streamsearch: 1.1.0 + cac@6.7.14: {} cacheable-lookup@7.0.0: {} @@ -3794,6 +4037,23 @@ snapshots: normalize-url: 8.0.1 responselike: 3.0.0 + call-bind-apply-helpers@1.0.1: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + call-bind@1.0.8: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-define-property: 1.0.1 + get-intrinsic: 1.2.6 + set-function-length: 1.2.2 + + call-bound@1.0.3: + dependencies: + call-bind-apply-helpers: 1.0.1 + get-intrinsic: 1.2.6 + chai@5.1.2: dependencies: assertion-error: 2.0.1 @@ -3824,8 +4084,6 @@ snapshots: dependencies: safe-buffer: 5.2.1 - cookie@0.5.0: {} - cookie@1.0.2: {} cross-spawn@7.0.6: @@ -3840,6 +4098,8 @@ snapshots: dependencies: ms: 2.1.3 + decode-uri-component@0.2.2: {} + decompress-response@6.0.0: dependencies: mimic-response: 3.1.0 @@ -3850,6 +4110,12 @@ snapshots: defer-to-connect@2.0.1: {} + define-data-property@1.1.4: + dependencies: + es-define-property: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + depd@2.0.0: {} dotenv-expand@10.0.0: {} @@ -3874,6 +4140,12 @@ snapshots: drizzle-orm: 0.38.3(postgres@3.4.5) zod: 3.24.1 + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + duplexify@4.1.3: dependencies: end-of-stream: 1.4.4 @@ -3901,7 +4173,15 @@ snapshots: dotenv: 16.4.7 dotenv-expand: 10.0.0 - es-module-lexer@1.5.4: {} + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-module-lexer@1.6.0: {} + + es-object-atoms@1.0.0: + dependencies: + es-errors: 1.3.0 esbuild-register@3.6.0(esbuild@0.19.12): dependencies: @@ -4022,6 +4302,8 @@ snapshots: event-target-shim@5.0.1: {} + eventemitter3@5.0.1: {} + events@3.3.0: {} execa@5.1.1: @@ -4102,6 +4384,10 @@ snapshots: fast-uri@3.0.3: {} + fast-xml-parser@4.5.1: + dependencies: + strnum: 1.0.5 + fastfall@1.5.1: dependencies: reusify: 1.0.4 @@ -4157,16 +4443,22 @@ snapshots: dependencies: to-regex-range: 5.0.1 + filter-obj@1.1.0: {} + find-my-way@9.1.0: dependencies: fast-deep-equal: 3.1.3 fast-querystring: 1.1.2 - safe-regex2: 4.0.0 + safe-regex2: 4.0.1 find-versions@5.1.0: dependencies: semver-regex: 4.0.5 + for-each@0.3.3: + dependencies: + is-callable: 1.2.7 + foreground-child@3.3.0: dependencies: cross-spawn: 7.0.6 @@ -4179,10 +4471,25 @@ snapshots: fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + generate-function@2.3.1: dependencies: is-property: 1.0.2 + get-intrinsic@1.2.6: + dependencies: + call-bind-apply-helpers: 1.0.1 + dunder-proto: 1.0.1 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + function-bind: 1.1.2 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + get-stream@6.0.1: {} get-stream@9.0.1: @@ -4218,6 +4525,8 @@ snapshots: globrex@0.1.2: {} + gopd@1.2.0: {} + got@13.0.0: dependencies: '@sindresorhus/is': 5.6.0 @@ -4261,10 +4570,29 @@ snapshots: graphql: 16.10.0 tslib: 2.8.1 + graphql-upload-minimal@1.6.1(graphql@16.10.0): + dependencies: + busboy: 1.6.0 + graphql: 16.10.0 + graphql@16.10.0: {} has-flag@4.0.0: {} + has-property-descriptors@1.0.2: + dependencies: + es-define-property: 1.0.1 + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + helmet@8.0.0: {} help-me@5.0.0: {} @@ -4300,10 +4628,23 @@ snapshots: ipaddr.js@1.9.1: {} + ipaddr.js@2.2.0: {} + + is-arguments@1.2.0: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + is-callable@1.2.7: {} + is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} + is-generator-function@1.0.10: + dependencies: + has-tostringtag: 1.0.2 + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 @@ -4318,6 +4659,10 @@ snapshots: is-stream@4.0.1: {} + is-typed-array@1.1.15: + dependencies: + which-typed-array: 1.1.18 + isexe@2.0.0: {} istanbul-lib-coverage@3.2.2: {} @@ -4367,6 +4712,8 @@ snapshots: kind-of@6.0.3: {} + layerr@3.0.0: {} + lefthook-darwin-arm64@1.10.1: optional: true @@ -4422,6 +4769,8 @@ snapshots: lodash.mergewith@4.6.2: {} + lodash@4.17.21: {} + loupe@3.1.2: {} lowercase-keys@3.0.0: {} @@ -4444,10 +4793,12 @@ snapshots: dependencies: semver: 7.6.3 - mercurius-integration-testing@9.0.0(fastify@5.2.0)(graphql@16.10.0)(mercurius@16.0.0(graphql@16.10.0)): + math-intrinsics@1.1.0: {} + + mercurius-integration-testing@9.0.1(fastify@5.2.0)(graphql@16.10.0)(mercurius@16.0.0(graphql@16.10.0)): dependencies: '@graphql-typed-document-node/core': 3.2.0(graphql@16.10.0) - cookie: 0.5.0 + cookie: 1.0.2 fastify: 5.2.0 graphql: 16.10.0 mercurius: 16.0.0(graphql@16.10.0) @@ -4456,6 +4807,12 @@ snapshots: - bufferutil - utf-8-validate + mercurius-upload@8.0.0(graphql@16.10.0): + dependencies: + fastify-plugin: 5.0.1 + graphql: 16.10.0 + graphql-upload-minimal: 1.6.1(graphql@16.10.0) + mercurius@16.0.0(graphql@16.10.0): dependencies: '@fastify/error': 4.0.0 @@ -4486,8 +4843,14 @@ snapshots: braces: 3.0.3 picomatch: 2.3.1 + mime-db@1.52.0: {} + mime-db@1.53.0: {} + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + mime@3.0.0: {} mimic-fn@2.1.0: {} @@ -4508,6 +4871,23 @@ snapshots: minimist@1.2.8: {} + minio@8.0.3: + dependencies: + async: 3.2.6 + block-stream2: 2.1.0 + browser-or-node: 2.1.1 + buffer-crc32: 1.0.0 + eventemitter3: 5.0.1 + fast-xml-parser: 4.5.1 + ipaddr.js: 2.2.0 + lodash: 4.17.21 + mime-types: 2.1.35 + query-string: 7.1.3 + stream-json: 1.9.1 + through2: 4.0.2 + web-encoding: 1.1.5 + xml2js: 0.6.2 + minipass@7.1.2: {} mnemonist@0.39.8: @@ -4613,6 +4993,8 @@ snapshots: optionalDependencies: '@napi-rs/nice': 1.0.1 + possible-typed-array-names@1.0.0: {} + postcss@8.4.49: dependencies: nanoid: 3.3.8 @@ -4637,6 +5019,13 @@ snapshots: qlobber@8.0.1: {} + query-string@7.1.3: + dependencies: + decode-uri-component: 0.2.2 + filter-obj: 1.1.0 + split-on-first: 1.1.0 + strict-uri-encode: 2.0.0 + queue-microtask@1.2.3: {} queue-tick@1.0.1: {} @@ -4710,7 +5099,7 @@ snapshots: safe-buffer@5.2.1: {} - safe-regex2@4.0.0: + safe-regex2@4.0.1: dependencies: ret: 0.5.0 @@ -4718,6 +5107,8 @@ snapshots: safer-buffer@2.1.2: {} + sax@1.4.1: {} + secure-json-parse@2.7.0: {} secure-json-parse@3.0.1: {} @@ -4736,6 +5127,15 @@ snapshots: set-cookie-parser@2.7.1: {} + set-function-length@1.2.2: + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.6 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + setprototypeof@1.2.0: {} shebang-command@2.0.0: @@ -4779,6 +5179,8 @@ snapshots: source-map@0.7.4: {} + split-on-first@1.1.0: {} + split2@4.2.0: {} stackback@0.0.2: {} @@ -4795,8 +5197,16 @@ snapshots: fastseries: 1.7.2 reusify: 1.0.4 + stream-chain@2.2.5: {} + + stream-json@1.9.1: + dependencies: + stream-chain: 2.2.5 + stream-shift@1.0.3: {} + streamsearch@1.1.0: {} + streamx@2.21.1: dependencies: fast-fifo: 1.3.2 @@ -4805,6 +5215,8 @@ snapshots: optionalDependencies: bare-events: 2.5.0 + strict-uri-encode@2.0.0: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -4838,6 +5250,8 @@ snapshots: strip-json-comments@3.1.1: {} + strnum@1.0.5: {} + strtok3@9.1.1: dependencies: '@tokenizer/token': 0.3.0 @@ -4867,13 +5281,17 @@ snapshots: dependencies: real-require: 0.2.0 + through2@4.0.2: + dependencies: + readable-stream: 3.6.2 + through@2.3.8: {} tiny-lru@11.2.11: {} tinybench@2.9.0: {} - tinyexec@0.3.1: {} + tinyexec@0.3.2: {} tinypool@1.0.2: {} @@ -4911,6 +5329,10 @@ snapshots: uint8array-extras@1.4.0: {} + ulidx@2.4.1: + dependencies: + layerr: 3.0.0 + unbzip2-stream@1.4.3: dependencies: buffer: 5.7.1 @@ -4920,13 +5342,21 @@ snapshots: util-deprecate@1.0.2: {} + util@0.12.5: + dependencies: + inherits: 2.0.4 + is-arguments: 1.2.0 + is-generator-function: 1.0.10 + is-typed-array: 1.1.15 + which-typed-array: 1.1.18 + uuidv7@1.0.2: {} vite-node@2.1.8(@types/node@22.10.2): dependencies: cac: 6.7.14 debug: 4.4.0 - es-module-lexer: 1.5.4 + es-module-lexer: 1.6.0 pathe: 1.1.2 vite: 5.4.11(@types/node@22.10.2) transitivePeerDependencies: @@ -4976,7 +5406,7 @@ snapshots: pathe: 1.1.2 std-env: 3.8.0 tinybench: 2.9.0 - tinyexec: 0.3.1 + tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 1.2.0 vite: 5.4.11(@types/node@22.10.2) @@ -4995,6 +5425,21 @@ snapshots: - supports-color - terser + web-encoding@1.1.5: + dependencies: + util: 0.12.5 + optionalDependencies: + '@zxing/text-encoding': 0.9.0 + + which-typed-array@1.1.18: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.3 + for-each: 0.3.3 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + which@2.0.2: dependencies: isexe: 2.0.0 @@ -5020,6 +5465,13 @@ snapshots: ws@8.18.0: {} + xml2js@0.6.2: + dependencies: + sax: 1.4.1 + xmlbuilder: 11.0.1 + + xmlbuilder@11.0.1: {} + xtend@4.0.2: {} yauzl@3.2.0: diff --git a/schema.graphql b/schema.graphql index 40fc5f2887e..721ed4e8065 100644 --- a/schema.graphql +++ b/schema.graphql @@ -26,7 +26,7 @@ type Advertisement { """Date time at the time the advertised event starts at.""" startAt: DateTime - """Type of the attachment.""" + """Mime type of the attachment.""" type: AdvertisementType """Date time at the time the advertisement was last updated.""" @@ -36,35 +36,129 @@ type Advertisement { updater: User } -"""""" type AdvertisementAttachment { - """Type of the attachment.""" - type: AdvertisementAttachmentType + """Mime type of the attachment.""" + mimeType: String - """URI to the attachment.""" - uri: String + """URL to the attachment.""" + url: String } """""" -input AdvertisementAttachmentInput { - """Type of the attachment.""" - type: AdvertisementAttachmentType! +enum AdvertisementType { + banner + menu + pop_up +} + +type AgendaFolder { + """ + GraphQL connection to traverse through the agenda folders that have the agenda folder as a parent folder. + """ + childFolders(after: String, before: String, first: Int, last: Int): AgendaFolderChildFoldersConnection + + """Date time at the time the agenda folder was last created.""" + createdAt: DateTime + + """User who created the agenda folder.""" + creator: User + + """Event associated to the agenda folder.""" + event: Event + + """Global identifier of the agenda folder.""" + id: ID! - """URI to the attachment.""" - uri: String! + """ + Boolean to tell if the agenda folder is meant to be a folder for agenda items or a parent for agenda folders. + """ + isAgendaItemFolder: Boolean + + """ + GraphQL connection to traverse through the agenda item associated to the agenda folder. + """ + items(after: String, before: String, first: Int, last: Int): AgendaFolderItemsConnection + + """Name of the agenda folder.""" + name: String + + """Agenda folder that is a parent folder to the agenda folder.""" + parentFolder: AgendaFolder + + """Date time at the time the agenda folder was last updated.""" + updatedAt: DateTime + + """User who last updated the agenda folder.""" + updater: User } """""" -enum AdvertisementAttachmentType { - image - video +type AgendaFolderChildFoldersConnection { + edges: [AgendaFolderChildFoldersConnectionEdge] + pageInfo: PageInfo! } """""" -enum AdvertisementType { - banner - menu - pop_up +type AgendaFolderChildFoldersConnectionEdge { + cursor: String! + node: AgendaFolder +} + +"""""" +type AgendaFolderItemsConnection { + edges: [AgendaFolderItemsConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type AgendaFolderItemsConnectionEdge { + cursor: String! + node: AgendaItem +} + +type AgendaItem { + """Date time at the time the agenda item was last created.""" + createdAt: DateTime + + """User who created the agenda item.""" + creator: User + + """Custom information about the agenda item.""" + description: String + + """Duration of the agenda item.""" + duration: String + + """Agenda folder associated to the agenda item.""" + event: AgendaFolder + + """Global identifier of the agenda item.""" + id: ID! + + """ + Key of the agenda item if it's type is "song". More information at [this](https://en.wikipedia.org/wiki/Key_(music)) link. + """ + key: String + + """Name of the agenda item.""" + name: String + + """Type of the agenda item.""" + type: AgendaItemType + + """Date time at the time the agenda item was last updated.""" + updatedAt: DateTime + + """User who last updated the agenda item.""" + updater: User +} + +"""""" +enum AgendaItemType { + general + note + scripture + song } """""" @@ -83,6 +177,101 @@ The `BigInt` scalar type represents non-fractional signed whole numeric values. """ scalar BigInt +type Chat { + """Mime type of the avatar of the chat.""" + avatarMimeType: String + + """URL to the avatar of the chat.""" + avatarURL: String + + """Date time at the time the chat was created.""" + createdAt: DateTime + + """User who created the chat.""" + creator: User + + """Custom information about the chat.""" + description: String + + """Global identifier of the chat.""" + id: ID! + + """ + GraphQL connection to traverse through the users that are members of the 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. + """ + messages(after: String, before: String, first: Int, last: Int): ChatMessagesConnection + + """Name of the chat.""" + name: String + + """Organization which the chat is associated to.""" + organization: Organization + + """Date time at the time the chat was last updated.""" + updatedAt: DateTime + + """User who last updated the chat.""" + updater: User +} + +"""""" +type ChatMembersConnection { + edges: [ChatMembersConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type ChatMembersConnectionEdge { + cursor: String! + node: User +} + +"""""" +enum ChatMembershipRole { + administrator + regular +} + +type ChatMessage { + """Body of the chat message.""" + body: String + + """Chat which the chat message belongs to.""" + chat: Chat + + """Date time at the time the chat message was created.""" + createdAt: DateTime + + """User who created the chat message.""" + creator: User + + """Global identifier of the chat message.""" + id: ID! + + """Parent chat message of the chat message.""" + parentChatMessage: ChatMessage + + """Date time at the time the chat message was last updated.""" + updatedAt: DateTime +} + +"""""" +type ChatMessagesConnection { + edges: [ChatMessagesConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type ChatMessagesConnectionEdge { + cursor: String! + node: ChatMessage +} + type Comment { """Body of the comment.""" body: String @@ -167,6 +356,83 @@ A field whose value conforms to the standard internet email address format as sp """ scalar EmailAddress +type Event { + """ + GraphQL connection to traverse through the agenda folders associated to 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.""" + createdAt: DateTime + + """User who created the event.""" + creator: User + + """Custom information about the event.""" + description: String + + """Date time at the time the event ends at.""" + endAt: DateTime + + """Global identifier of the event.""" + id: ID! + + """Name of the event.""" + name: String + + """Organization associated to the event.""" + organization: Organization + + """Date time at the time the event starts at.""" + startAt: DateTime + + """Date time at the time the event was last updated.""" + updatedAt: DateTime + + """User who last updated the event.""" + updater: User + + """ + GraphQL connection to traverse through the venues that are associated to the event. + """ + venues(after: String, before: String, first: Int, last: Int): EventVenuesConnection +} + +"""""" +type EventAgendaFoldersConnection { + edges: [EventAgendaFoldersConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type EventAgendaFoldersConnectionEdge { + cursor: String! + node: AgendaFolder +} + +type EventAttachment { + """Mime type of the attachment.""" + mimeType: String + + """URL to the attachment.""" + url: String +} + +"""""" +type EventVenuesConnection { + edges: [EventVenuesConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type EventVenuesConnectionEdge { + cursor: String! + node: Venue +} + type Fund { """ GraphQL connection to traverse through the fund campaigns that are associated to the fund. @@ -733,12 +999,30 @@ type Mutation { """Mutation field to create an advertisement.""" createAdvertisement(input: MutationCreateAdvertisementInput!): Advertisement + """Mutation field to create an agenda folder.""" + createAgendaFolder(input: MutationCreateAgendaFolderInput!): AgendaFolder + + """Mutation field to create an agenda item.""" + createAgendaItem(input: MutationCreateAgendaItemInput!): AgendaItem + + """Mutation field to create a chat.""" + createChat(input: MutationCreateChatInput!): Chat + + """Mutation field to create a chat membership.""" + createChatMembership(input: MutationCreateChatMembershipInput!): Chat + + """Mutation field to create a chat message.""" + createChatMessage(input: MutationCreateChatMessageInput!): ChatMessage + """Mutation field to create a comment.""" createComment(input: MutationCreateCommentInput!): Comment """Mutation field to create a comment vote.""" createCommentVote(input: MutationCreateCommentVoteInput!): Comment + """Mutation field to create an event.""" + createEvent(input: MutationCreateEventInput!): Event + """Mutation field to create a fund.""" createFund(input: MutationCreateFundInput!): Fund @@ -763,15 +1047,39 @@ type Mutation { """Mutation field to create a tag.""" createTag(input: MutationCreateTagInput!): Tag + """Mutation field to create a tag folder.""" + createTagFolder(input: MutationCreateTagFolderInput!): TagFolder + """Mutation field to create a user.""" createUser( """Input required to create a user.""" input: MutationCreateUserInput! ): AuthenticationPayload + """Mutation field to create a venue.""" + createVenue(input: MutationCreateVenueInput!): Venue + + """Mutation field to create a venue booking.""" + createVenueBooking(input: MutationCreateVenueBookingInput!): Venue + """Mutation field to delete an advertisement.""" deleteAdvertisement(input: MutationDeleteAdvertisementInput!): Advertisement + """Mutation field to delete an agenda folder.""" + deleteAgendaFolder(input: MutationDeleteAgendaFolderInput!): AgendaFolder + + """Mutation field to delete an agenda item.""" + deleteAgendaItem(input: MutationDeleteAgendaItemInput!): AgendaItem + + """Mutation field to delete a chat.""" + deleteChat(input: MutationDeleteChatInput!): Chat + + """Mutation field to delete a chat membership.""" + deleteChatMembership(input: MutationDeleteChatMembershipInput!): Chat + + """Mutation field to delete a chat message.""" + deleteChatMessage(input: MutationDeleteChatMessageInput!): ChatMessage + """Mutation field to delete a comment.""" deleteComment(input: MutationDeleteCommentInput!): Comment @@ -781,6 +1089,9 @@ type Mutation { """Mutation field to delete the current user.""" deleteCurrentUser: User + """Mutation field to delete an event.""" + deleteEvent(input: MutationDeleteEventInput!): Event + """Mutation field to delete a fund.""" deleteFund(input: MutationDeleteFundInput!): Fund @@ -805,12 +1116,21 @@ type Mutation { """Mutation field to delete a tag.""" deleteTag(input: MutationDeleteTagInput!): Tag + """Mutation field to delete a tagFolder.""" + deleteTagFolder(input: MutationDeleteTagFolderInput!): TagFolder + """Mutation field to delete a user.""" deleteUser( """Input required to delete a user.""" input: MutationDeleteUserInput! ): User + """Mutation field to delete a venue.""" + deleteVenue(input: MutationDeleteVenueInput!): Venue + + """Mutation field to delete an venue booking.""" + deleteVenueBooking(input: MutationDeleteVenueBookingInput!): Venue + """Mutation field to sign up to talawa.""" signUp( """Input required to sign up to talawa.""" @@ -820,6 +1140,21 @@ type Mutation { """Mutation field to update an advertisement.""" updateAdvertisement(input: MutationUpdateAdvertisementInput!): Advertisement + """Mutation field to update an agenda folder.""" + updateAgendaFolder(input: MutationUpdateAgendaFolderInput!): AgendaFolder + + """Mutation field to update an agenda item.""" + updateAgendaItem(input: MutationUpdateAgendaItemInput!): AgendaItem + + """Mutation field to update a chat.""" + updateChat(input: MutationUpdateChatInput!): Chat + + """Mutation field to update a chat membership.""" + updateChatMembership(input: MutationUpdateChatMembershipInput!): Chat + + """Mutation field to update a chat message.""" + updateChatMessage(input: MutationUpdateChatMessageInput!): ChatMessage + """Mutation field to update a comment.""" updateComment(input: MutationUpdateCommentInput!): Comment @@ -832,6 +1167,9 @@ type Mutation { input: MutationUpdateCurrentUserInput! ): User + """Mutation field to update an event.""" + updateEvent(input: MutationUpdateEventInput!): Event + """Mutation field to update a fund.""" updateFund(input: MutationUpdateFundInput!): Fund @@ -856,17 +1194,23 @@ type Mutation { """Mutation field to update a tag.""" updateTag(input: MutationUpdateTagInput!): Tag + """Mutation field to update a tag folder.""" + updateTagFolder(input: MutationUpdateTagFolderInput!): TagFolder + """Mutation field to update a user.""" updateUser( """Input required to update a user.""" input: MutationUpdateUserInput! ): User + + """Mutation field to update a venue.""" + updateVenue(input: MutationUpdateVenueInput!): Venue } """""" input MutationCreateAdvertisementInput { """Attachments of the advertisement.""" - attachments: [AdvertisementAttachmentInput!] + attachments: [Upload!] """Custom information about the advertisement.""" description: String @@ -887,6 +1231,89 @@ input MutationCreateAdvertisementInput { type: AdvertisementType! } +"""""" +input MutationCreateAgendaFolderInput { + """Global identifier of the event the agenda folder is associated to.""" + eventId: ID! + + """ + Boolean to tell if the agenda folder is meant to be a folder for agenda items or a parent for agenda folders. + """ + isAgendaItemFolder: Boolean! + + """Name of the agenda folder.""" + name: String! + + """ + Global identifier of the agenda folder the agenda folder is associated to. + """ + parentFolderId: ID +} + +"""""" +input MutationCreateAgendaItemInput { + """Custom information about the agenda item.""" + description: String + + """Duration of the agenda item.""" + duration: String + + """ + Global identifier of the agenda folder the agenda item is associated to. + """ + folderId: ID! + + """ + Key of the agenda item if it's type is "song". More information at [this](https://en.wikipedia.org/wiki/Key_(music)) link. + """ + key: String + + """Name of the agenda item.""" + name: String! + + """Type of the agenda item.""" + type: AgendaItemType! +} + +"""""" +input MutationCreateChatInput { + """Avatar of the chat.""" + avatar: Upload + + """Custom information about the chat.""" + description: String + + """Name of the chat.""" + name: String! + + """Global identifier of the associated organization.""" + organizationId: ID! +} + +"""""" +input MutationCreateChatMembershipInput { + """Global identifier of the associated chat.""" + chatId: ID! + + """Global identifier of the associated user.""" + memberId: ID! + + """Role assigned to the user within the chat.""" + role: ChatMembershipRole +} + +"""""" +input MutationCreateChatMessageInput { + """Body of the chat message.""" + body: String! + + """Global identifier of the associated chat.""" + chatId: ID! + + """Global identifier of the associated parent chat message.""" + parentChatMessageId: ID! +} + """""" input MutationCreateCommentInput { """Body of the comment.""" @@ -905,6 +1332,27 @@ input MutationCreateCommentVoteInput { type: CommentVoteType! } +"""""" +input MutationCreateEventInput { + """Attachments of the event.""" + attachments: [Upload!] + + """Custom information about the event.""" + description: String + + """Date time at the time the event ends at.""" + endAt: DateTime! + + """Name of the event.""" + name: String! + + """Global identifier of the associated organization.""" + organizationId: ID! + + """Date time at the time the event starts at.""" + startAt: DateTime! +} + """""" input MutationCreateFundCampaignInput { """Currency code of the fund campaign.""" @@ -958,8 +1406,8 @@ input MutationCreateOrganizationInput { """Address of the organization.""" address: String - """URI to the avatar of the organization.""" - avatarURI: String + """Avatar of the organization.""" + avatar: Upload """Name of the city where the organization resides in.""" city: String @@ -995,7 +1443,7 @@ input MutationCreateOrganizationMembershipInput { """""" input MutationCreatePostInput { """Attachments of the post.""" - attachments: [PostAttachmentInput!] + attachments: [Upload!] """Caption about the post.""" caption: String! @@ -1018,19 +1466,28 @@ input MutationCreatePostVoteInput { type: PostVoteType! } +"""""" +input MutationCreateTagFolderInput { + """Name of the tag.""" + name: String! + + """Global identifier of the associated organization.""" + organizationId: ID! + + """Global identifier of the associated parent tag folder.""" + parentFolderId: ID +} + """""" input MutationCreateTagInput { - """Boolean to tell if the tag is to be used as a tag folder.""" - isFolder: Boolean! + """Global identifier of the associated tag folder.""" + folderId: ID """Name of the tag.""" name: String! """Global identifier of the associated organization.""" organizationId: ID! - - """Global identifier of the parent tag.""" - parentTagId: ID } """""" @@ -1038,8 +1495,8 @@ input MutationCreateUserInput { """Address of the user.""" address: String - """URI to the avatar of the user.""" - avatarURI: String + """Avatar of the user.""" + avatar: Upload """Date of birth of the user.""" birthDate: Date @@ -1101,8 +1558,65 @@ input MutationCreateUserInput { } """""" -input MutationDeleteAdvertisementInput { - """Global identifier of the advertisement.""" +input MutationCreateVenueBookingInput { + """Global identifier of the associated event.""" + eventId: ID! + + """Global identifier of the associated venue.""" + venueId: ID! +} + +"""""" +input MutationCreateVenueInput { + """Attachments of the venue.""" + attachments: [Upload!] + + """Custom information about the venue.""" + description: String + + """Name of the venue.""" + name: String! + + """Global identifier of the associated organization.""" + organizationId: ID! +} + +"""""" +input MutationDeleteAdvertisementInput { + """Global identifier of the advertisement.""" + id: ID! +} + +"""""" +input MutationDeleteAgendaFolderInput { + """Global identifier of the agenda folder.""" + id: ID! +} + +"""""" +input MutationDeleteAgendaItemInput { + """Global identifier of the agenda item.""" + id: ID! +} + +"""""" +input MutationDeleteChatInput { + """Global identifier of the chat.""" + id: ID! +} + +"""""" +input MutationDeleteChatMembershipInput { + """Global identifier of the associated chat.""" + chatId: ID! + + """Global identifier of the associated user.""" + memberId: ID! +} + +"""""" +input MutationDeleteChatMessageInput { + """Global identifier of the chat message.""" id: ID! } @@ -1121,6 +1635,12 @@ input MutationDeleteCommentVoteInput { creatorId: ID! } +"""""" +input MutationDeleteEventInput { + """Global identifier of the event.""" + id: ID! +} + """""" input MutationDeleteFundCampaignInput { """Global identifier of the fund campaign.""" @@ -1169,6 +1689,12 @@ input MutationDeletePostVoteInput { postId: ID! } +"""""" +input MutationDeleteTagFolderInput { + """Global identifier of the tag folder.""" + id: ID! +} + """""" input MutationDeleteTagInput { """Global identifier of the tag.""" @@ -1181,13 +1707,28 @@ input MutationDeleteUserInput { id: ID! } +"""""" +input MutationDeleteVenueBookingInput { + """Global identifier of the associated event.""" + eventId: ID! + + """Global identifier of the associated venue.""" + venueId: ID! +} + +"""""" +input MutationDeleteVenueInput { + """Global identifier of the venue.""" + id: ID! +} + """""" input MutationSignUpInput { """Address of the user.""" address: String - """URI to the avatar of the user.""" - avatarURI: String + """Avatar of the user.""" + avatar: Upload """Date of birth of the user.""" birthDate: Date @@ -1266,6 +1807,79 @@ input MutationUpdateAdvertisementInput { type: AdvertisementType } +"""""" +input MutationUpdateAgendaFolderInput { + """Global identifier of the agenda folder.""" + id: ID! + + """Name of the agenda folder.""" + name: String + + """ + Global identifier of the agenda folder the agenda folder is associated to. + """ + parentFolderId: ID +} + +"""""" +input MutationUpdateAgendaItemInput { + """Custom information about the agenda item.""" + description: String + + """Duration of the agenda item.""" + duration: String + + """Global identifier of the associated agenda folder.""" + folderId: ID + + """Global identifier of the agenda item.""" + id: ID! + + """ + Key of the agenda item if it's type is "song". More information at [this](https://en.wikipedia.org/wiki/Key_(music)) link. + """ + key: String + + """Name of the agenda item.""" + name: String +} + +"""""" +input MutationUpdateChatInput { + """Avatar of the chat.""" + avatar: Upload + + """Custom information about the chat.""" + description: String + + """Global identifier of the chat.""" + id: ID! + + """Name of the chat.""" + name: String +} + +"""""" +input MutationUpdateChatMembershipInput { + """Global identifier of the associated chat.""" + chatId: ID! + + """Global identifier of the associated user.""" + memberId: ID! + + """Role assigned to the user within the chat.""" + role: ChatMembershipRole! +} + +"""""" +input MutationUpdateChatMessageInput { + """Body of the chat message.""" + body: String! + + """Global identifier of the chat message.""" + id: ID! +} + """""" input MutationUpdateCommentInput { """Body of the comment.""" @@ -1289,8 +1903,8 @@ input MutationUpdateCurrentUserInput { """Address of the user.""" address: String - """URI to the avatar of the user.""" - avatarURI: String + """Avatar of the user.""" + avatar: Upload """Date of birth of the user.""" birthDate: Date @@ -1345,6 +1959,24 @@ input MutationUpdateCurrentUserInput { workPhoneNumber: PhoneNumber } +"""""" +input MutationUpdateEventInput { + """Custom information about the event.""" + description: String + + """Date time at the time the event ends at.""" + endAt: DateTime + + """Global identifier of the event.""" + id: ID! + + """Name of the event.""" + name: String + + """Date time at the time the event starts at.""" + startAt: DateTime +} + """""" input MutationUpdateFundCampaignInput { """Date time at the time the fund campaign ends at.""" @@ -1392,8 +2024,8 @@ input MutationUpdateOrganizationInput { """Address of the organization.""" address: String - """URI to the avatar of the organization.""" - avatarURI: String + """Avatar of the organization.""" + avatar: Upload """Name of the city where the organization resides in.""" city: String @@ -1450,16 +2082,28 @@ input MutationUpdatePostVoteInput { type: PostVoteType! } +"""""" +input MutationUpdateTagFolderInput { + """Global identifier of the tag folder.""" + id: ID! + + """Name of the tag folder.""" + name: String + + """Global identifier of associated parent tag folder.""" + parentFolderId: ID +} + """""" input MutationUpdateTagInput { + """Global identifier of associated tag folder.""" + folderId: ID + """Global identifier of the tag.""" id: ID! """Name of the tag.""" name: String - - """Global identifier of associated parent tag.""" - parentTagId: ID } """""" @@ -1467,8 +2111,8 @@ input MutationUpdateUserInput { """Address of the user.""" address: String - """URI to the avatar of the user.""" - avatarURI: String + """Avatar of the user.""" + avatar: Upload """Date of birth of the user.""" birthDate: Date @@ -1532,6 +2176,18 @@ input MutationUpdateUserInput { workPhoneNumber: PhoneNumber } +"""""" +input MutationUpdateVenueInput { + """Custom information about the venue.""" + description: String + + """Global identifier of the venue.""" + id: ID! + + """Name of the venue.""" + name: String +} + type Organization { """Address of the organization.""" address: String @@ -1541,8 +2197,16 @@ type Organization { """ advertisements(after: String, before: String, first: Int, last: Int): OrganizationAdvertisementsConnection - """URI to the avatar of the organization.""" - avatarURI: String + """Mime type of the avatar of the organization.""" + avatarMimeType: String + + """URL to the avatar of the organization.""" + avatarURL: String + + """ + GraphQL connection to traverse through the chats that are associated to the organization. + """ + chats(after: String, before: String, first: Int, last: Int): OrganizationChatsConnection """Name of the city where the organization exists in.""" city: String @@ -1559,6 +2223,11 @@ type Organization { """Custom information about the organization.""" description: String + """ + GraphQL connection to traverse through the events associated 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. """ @@ -1597,6 +2266,11 @@ type Organization { """Name of the state the organization exists in.""" state: String + """ + GraphQL connection to traverse through the tag folders associated to the organization. + """ + tagFolders(after: String, before: String, first: Int, last: Int): OrganizationTagFoldersConnection + """ GraphQL connection to traverse through the tags associated to the organization. """ @@ -1607,6 +2281,11 @@ type Organization { """User who last updated the organization.""" updater: User + + """ + GraphQL connection to traverse through the venues associated to the organization. + """ + venues(after: String, before: String, first: Int, last: Int): OrganizationVenuesConnection } """""" @@ -1621,6 +2300,30 @@ type OrganizationAdvertisementsConnectionEdge { node: Advertisement } +"""""" +type OrganizationChatsConnection { + edges: [OrganizationChatsConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type OrganizationChatsConnectionEdge { + cursor: String! + node: Chat +} + +"""""" +type OrganizationEventsConnection { + edges: [OrganizationEventsConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type OrganizationEventsConnectionEdge { + cursor: String! + node: Event +} + """""" type OrganizationFundsConnection { edges: [OrganizationFundsConnectionEdge] @@ -1675,6 +2378,18 @@ type OrganizationPostsConnectionEdge { node: Post } +"""""" +type OrganizationTagFoldersConnection { + edges: [OrganizationTagFoldersConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type OrganizationTagFoldersConnectionEdge { + cursor: String! + node: TagFolder +} + """""" type OrganizationTagsConnection { edges: [OrganizationTagsConnectionEdge] @@ -1687,6 +2402,18 @@ type OrganizationTagsConnectionEdge { node: Tag } +"""""" +type OrganizationVenuesConnection { + edges: [OrganizationVenuesConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type OrganizationVenuesConnectionEdge { + cursor: String! + node: Venue +} + type PageInfo { endCursor: String hasNextPage: Boolean! @@ -1752,28 +2479,12 @@ type Post { updater: User } -"""""" type PostAttachment { - """Type of the attachment.""" - type: PostAttachmentType - - """URI to the attachment.""" - uri: String -} - -"""""" -input PostAttachmentInput { - """Type of the attachment.""" - type: PostAttachmentType! + """Mime type of the attachment.""" + mimeType: String - """URI to the attachment.""" - uri: String! -} - -"""""" -enum PostAttachmentType { - image - video + """URL to the attachment.""" + url: String } """""" @@ -1822,12 +2533,27 @@ type Query { """Query field to read an advertisement.""" advertisement(input: QueryAdvertisementInput!): Advertisement + """Query field to read an agenda folder.""" + agendaFolder(input: QueryAgendaFolderInput!): AgendaFolder + + """Query field to read an agenda item.""" + agendaItem(input: QueryAgendaItemInput!): AgendaItem + + """Query field to read a chat.""" + chat(input: QueryChatInput!): Chat + + """Query field to read a chat message.""" + chatMessage(input: QueryChatMessageInput!): ChatMessage + """Query field to read a comment.""" comment(input: QueryCommentInput!): Comment """Query field to read a user.""" currentUser: User + """Query field to read an event.""" + event(input: QueryEventInput!): Event + """Query field to read a fund.""" fund(input: QueryFundInput!): Fund @@ -1860,11 +2586,14 @@ type Query { """Query field to read a tag.""" tag(input: QueryTagInput!): Tag + """Query field to read a tag folder.""" + tagFolder(input: QueryTagFolderInput!): TagFolder + """Query field to read a user.""" - user( - """Input required to read a user.""" - input: QueryUserInput - ): User + user(input: QueryUserInput!): User + + """Query field to read a venue.""" + venue(input: QueryVenueInput!): Venue } """""" @@ -1873,12 +2602,42 @@ input QueryAdvertisementInput { id: String! } +"""""" +input QueryAgendaFolderInput { + """Global id of the agenda folder.""" + id: String! +} + +"""""" +input QueryAgendaItemInput { + """Global id of the agenda item.""" + id: String! +} + +"""""" +input QueryChatInput { + """Global id of the chat.""" + id: String! +} + +"""""" +input QueryChatMessageInput { + """Global id of the chat message.""" + id: String! +} + """""" input QueryCommentInput { """Global id of the comment.""" id: String! } +"""""" +input QueryEventInput { + """Global id of the event.""" + id: String! +} + """""" input QueryFundCampaignInput { """Global id of the fund campaign.""" @@ -1918,6 +2677,12 @@ input QuerySignInInput { password: String! } +"""""" +input QueryTagFolderInput { + """Global id of the tag folder.""" + id: String! +} + """""" input QueryTagInput { """Global id of the tag.""" @@ -1930,33 +2695,44 @@ input QueryUserInput { id: String! } -type Tag { +"""""" +input QueryVenueInput { + """Global id of the venue.""" + id: String! +} + +type Subscription { """ - GraphQL connection to traverse through the tags that have the tag as their parent tag. + Subscription field to subscribe to the event of creation of a chat message. """ - childTags(after: String, before: String, first: Int, last: Int): TagChildTagsConnection + chatMessageCreate(input: SubscriptionChatMessageCreateInput!): ChatMessage +} + +"""""" +input SubscriptionChatMessageCreateInput { + """Global id of the chat.""" + id: String! +} +type Tag { """Date time at the time the tag was created.""" createdAt: DateTime """User who created the tag.""" creator: User + """Tag folder the tag is associated to.""" + folder: TagFolder + """Global identifier of the tag.""" id: ID! - """Boolean to tell if the tag is to be used as a tag folder.""" - isFolder: Boolean - """Name of the tag.""" name: String - """Organization which the tag belongs to.""" + """Organization the tag is associated to.""" organization: Organization - """Parent tag of the tag.""" - parentTagFolder: Tag - """Date time at the time the tag was last updated.""" updatedAt: DateTime @@ -1964,24 +2740,78 @@ type Tag { updater: User } +type TagFolder { + """ + GraphQL connection to traverse through the tag folders that have the tag folder as their parent 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.""" + creator: User + + """Global identifier of the tag folder.""" + id: ID! + + """Name of the tag folder.""" + name: String + + """Organization which the tag folder is associated to.""" + organization: Organization + + """Parent folder of the tag folder.""" + parentFolder: TagFolder + + """ + GraphQL connection to traverse through the tags associated to the tag folder. + """ + tags(after: String, before: String, first: Int, last: Int): TagFolderTagsConnection + + """Date time at the time the tag folder was last updated.""" + updatedAt: DateTime + + """User who last updated the tag folder.""" + updater: User +} + +"""""" +type TagFolderChildFoldersConnection { + edges: [TagFolderChildFoldersConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type TagFolderChildFoldersConnectionEdge { + cursor: String! + node: TagFolder +} + """""" -type TagChildTagsConnection { - edges: [TagChildTagsConnectionEdge] +type TagFolderTagsConnection { + edges: [TagFolderTagsConnectionEdge] pageInfo: PageInfo! } """""" -type TagChildTagsConnectionEdge { +type TagFolderTagsConnectionEdge { cursor: String! node: Tag } +"""The `Upload` scalar type represents a file upload.""" +scalar Upload + type User { """Address of the user.""" address: String - """URI to the avatar of the user.""" - avatarURI: String + """Mime type of the avatar of the user.""" + avatarMimeType: String + + """URL to the avatar of the user.""" + avatarURL: String """Date of birth of the user.""" birthDate: Date @@ -2119,4 +2949,55 @@ type UserOrganizationsWhereMemberConnectionEdge { enum UserRole { administrator regular +} + +type Venue { + """Date time at the time the venue was created.""" + createdAt: DateTime + + """User who created the venue.""" + creator: User + + """Custom information about the venue.""" + description: String + + """ + GraphQL connection to traverse through the events associated to the venue. + """ + events(after: String, before: String, first: Int, last: Int): VenueEventsConnection + + """Global identifier of the venue.""" + id: ID! + + """Name of the venue.""" + name: String + + """Organization associated to the venue.""" + organization: Organization + + """Date time at the time the venue was last updated.""" + updatedAt: DateTime + + """User who last updated the venue.""" + updater: User +} + +type VenueAttachment { + """Mime type of the attachment.""" + mimeType: String + + """URL to the attachment.""" + url: String +} + +"""""" +type VenueEventsConnection { + edges: [VenueEventsConnectionEdge] + pageInfo: PageInfo! +} + +"""""" +type VenueEventsConnectionEdge { + cursor: String! + node: Event } \ No newline at end of file diff --git a/src/drizzle/enums/advertisementAttachmentMimeType.ts b/src/drizzle/enums/advertisementAttachmentMimeType.ts new file mode 100644 index 00000000000..fb267939e43 --- /dev/null +++ b/src/drizzle/enums/advertisementAttachmentMimeType.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +import { imageMimeTypeEnum } from "./imageMimeType"; +import { videoMimeTypeEnum } from "./videoMimeType"; + +/** + * Possible variants of the type of an attachement of an advertisement. + */ +export const advertisementAttachmentMimeTypeEnum = z.enum([ + ...imageMimeTypeEnum.options, + ...videoMimeTypeEnum.options, +]); diff --git a/src/drizzle/enums/advertisementAttachmentType.ts b/src/drizzle/enums/advertisementAttachmentType.ts deleted file mode 100644 index b9b30bd03a8..00000000000 --- a/src/drizzle/enums/advertisementAttachmentType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { z } from "zod"; - -/** - * Possible variants of the type of an attachement of an advertisement. - */ -export const advertisementAttachmentTypeEnum = z.enum(["image", "video"]); diff --git a/src/drizzle/enums/eventAttachmentMimeType.ts b/src/drizzle/enums/eventAttachmentMimeType.ts new file mode 100644 index 00000000000..ed3df8f2064 --- /dev/null +++ b/src/drizzle/enums/eventAttachmentMimeType.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +import { imageMimeTypeEnum } from "./imageMimeType"; +import { videoMimeTypeEnum } from "./videoMimeType"; + +/** + * Possible variants of the type of an attachement of an event. + */ +export const eventAttachmentMimeTypeEnum = z.enum([ + ...imageMimeTypeEnum.options, + ...videoMimeTypeEnum.options, +]); diff --git a/src/drizzle/enums/eventAttachmentType.ts b/src/drizzle/enums/eventAttachmentType.ts deleted file mode 100644 index 1e24f56f5c9..00000000000 --- a/src/drizzle/enums/eventAttachmentType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { z } from "zod"; - -/** - * Possible variants of the type of an attachement of an event. - */ -export const eventAttachmentTypeEnum = z.enum(["image", "video"]); diff --git a/src/drizzle/enums/imageMimeType.ts b/src/drizzle/enums/imageMimeType.ts new file mode 100644 index 00000000000..ae00380d2b4 --- /dev/null +++ b/src/drizzle/enums/imageMimeType.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; + +/** + * Possible variants of the type of an image. + */ +export const imageMimeTypeEnum = z.enum([ + "image/avif", + "image/jpeg", + "image/png", + "image/webp", +]); diff --git a/src/drizzle/enums/postAttachmentMimeType.ts b/src/drizzle/enums/postAttachmentMimeType.ts new file mode 100644 index 00000000000..42f123a2913 --- /dev/null +++ b/src/drizzle/enums/postAttachmentMimeType.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +import { imageMimeTypeEnum } from "./imageMimeType"; +import { videoMimeTypeEnum } from "./videoMimeType"; + +/** + * Possible variants of the type of an attachement of a post. + */ +export const postAttachmentMimeTypeEnum = z.enum([ + ...imageMimeTypeEnum.options, + ...videoMimeTypeEnum.options, +]); diff --git a/src/drizzle/enums/postAttachmentType.ts b/src/drizzle/enums/postAttachmentType.ts deleted file mode 100644 index 45e0fb7cb0f..00000000000 --- a/src/drizzle/enums/postAttachmentType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { z } from "zod"; - -/** - * Possible variants of the type of an attachement of a post. - */ -export const postAttachmentTypeEnum = z.enum(["image", "video"]); diff --git a/src/drizzle/enums/venueAttachmentMimeType.ts b/src/drizzle/enums/venueAttachmentMimeType.ts new file mode 100644 index 00000000000..8093c859e10 --- /dev/null +++ b/src/drizzle/enums/venueAttachmentMimeType.ts @@ -0,0 +1,11 @@ +import { z } from "zod"; +import { imageMimeTypeEnum } from "./imageMimeType"; +import { videoMimeTypeEnum } from "./videoMimeType"; + +/** + * Possible variants of the type of an attachement of an event venue. + */ +export const venueAttachmentMimeTypeEnum = z.enum([ + ...imageMimeTypeEnum.options, + ...videoMimeTypeEnum.options, +]); diff --git a/src/drizzle/enums/venueAttachmentType.ts b/src/drizzle/enums/venueAttachmentType.ts deleted file mode 100644 index a653991f566..00000000000 --- a/src/drizzle/enums/venueAttachmentType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { z } from "zod"; - -/** - * Possible variants of the type of an attachement of an event venue. - */ -export const venueAttachmentTypeEnum = z.enum(["image", "video"]); diff --git a/src/drizzle/enums/videoMimeType.ts b/src/drizzle/enums/videoMimeType.ts new file mode 100644 index 00000000000..131311516bd --- /dev/null +++ b/src/drizzle/enums/videoMimeType.ts @@ -0,0 +1,6 @@ +import { z } from "zod"; + +/** + * Possible variants of the type of a video. + */ +export const videoMimeTypeEnum = z.enum(["video/mp4", "video/webm"]); diff --git a/src/drizzle/tables/advertisementAttachments.ts b/src/drizzle/tables/advertisementAttachments.ts index 5500d52ce4e..cca68084f1a 100755 --- a/src/drizzle/tables/advertisementAttachments.ts +++ b/src/drizzle/tables/advertisementAttachments.ts @@ -1,7 +1,7 @@ import { relations, sql } from "drizzle-orm"; import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; -import { advertisementAttachmentTypeEnum } from "~/src/drizzle/enums/advertisementAttachmentType"; +import { advertisementAttachmentMimeTypeEnum } from "~/src/drizzle/enums/advertisementAttachmentMimeType"; import { advertisementsTable } from "./advertisements"; import { usersTable } from "./users"; @@ -38,11 +38,15 @@ export const advertisementAttachmentsTable = pgTable( onUpdate: "cascade", }), /** - * Type of the attachment. + * Mime type of the attachment. */ - type: text("type", { - enum: advertisementAttachmentTypeEnum.options, + mimeType: text("mime_type", { + enum: advertisementAttachmentMimeTypeEnum.options, }).notNull(), + /** + * Identifier name of the attachment. + */ + name: text("name", {}).notNull(), /** * Date time at the time the attachment was last updated. */ @@ -60,10 +64,6 @@ export const advertisementAttachmentsTable = pgTable( onDelete: "set null", onUpdate: "cascade", }), - /** - * URI to the attachment. - */ - uri: text("uri", {}).notNull(), }, (self) => [ index().on(self.advertisementId), @@ -106,6 +106,6 @@ export const advertisementAttachmentsTableRelations = relations( export const advertisementAttachmentsTableInsertSchema = createInsertSchema( advertisementAttachmentsTable, { - uri: (schema) => schema.uri.min(1), + name: (schema) => schema.name.min(1), }, ); diff --git a/src/drizzle/tables/advertisements.ts b/src/drizzle/tables/advertisements.ts index fec86494c87..85ff09eaefe 100755 --- a/src/drizzle/tables/advertisements.ts +++ b/src/drizzle/tables/advertisements.ts @@ -92,7 +92,7 @@ export const advertisementsTable = pgTable( onUpdate: "cascade", }), /** - * Type of the attachment. + * Mime type of the attachment. */ type: text("type", { enum: advertisementTypeEnum.options, diff --git a/src/drizzle/tables/chats.ts b/src/drizzle/tables/chats.ts index b35227ae2d1..b352f5ba655 100644 --- a/src/drizzle/tables/chats.ts +++ b/src/drizzle/tables/chats.ts @@ -2,6 +2,7 @@ import { relations, sql } from "drizzle-orm"; import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { uuidv7 } from "uuidv7"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { chatMembershipsTable } from "./chatMemberships"; import { chatMessagesTable } from "./chatMessages"; import { organizationsTable } from "./organizations"; @@ -14,9 +15,15 @@ export const chatsTable = pgTable( "chats", { /** - * URI to the avatar of the chat. + * Mime type of the avatar of the chat. */ - avatarURI: text("avatar_uri"), + avatarMimeType: text("avatar_mime_type", { + enum: imageMimeTypeEnum.options, + }), + /** + * Primary unique identifier of the chat's avatar. + */ + avatarName: text("avatar_name"), /** * Date time at the time the chat was created. */ @@ -100,7 +107,7 @@ export const chatsTableRelations = relations(chatsTable, ({ one, many }) => ({ * One to many relationship from `chats` table to `chatMessages` table. */ chatMessagesWhereChat: many(chatMessagesTable, { - relationName: "chats.id:chatMessages.chat_id", + relationName: "chat_messages.chat_id:chats.id", }), /** * Many to one relationship from `chats` table to `organizations` table. @@ -121,7 +128,7 @@ export const chatsTableRelations = relations(chatsTable, ({ one, many }) => ({ })); export const chatsTableInsertSchema = createInsertSchema(chatsTable, { - avatarURI: (schema) => schema.avatarURI.min(1), + avatarName: (schema) => schema.avatarName.min(1), description: (schema) => schema.description.min(1).max(2048), name: (schema) => schema.name.min(1).max(256), }); diff --git a/src/drizzle/tables/eventAttachments.ts b/src/drizzle/tables/eventAttachments.ts index 4d9a8d600ba..159c82cc9d8 100755 --- a/src/drizzle/tables/eventAttachments.ts +++ b/src/drizzle/tables/eventAttachments.ts @@ -1,7 +1,7 @@ import { relations, sql } from "drizzle-orm"; import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; -import { eventAttachmentTypeEnum } from "~/src/drizzle/enums/eventAttachmentType"; +import { eventAttachmentMimeTypeEnum } from "~/src/drizzle/enums/eventAttachmentMimeType"; import { eventsTable } from "./events"; import { usersTable } from "./users"; @@ -38,11 +38,15 @@ export const eventAttachmentsTable = pgTable( onUpdate: "cascade", }), /** - * Type of the attachment. + * Mime type of the attachment. */ - type: text("type", { - enum: eventAttachmentTypeEnum.options, + mimeType: text("mime_type", { + enum: eventAttachmentMimeTypeEnum.options, }).notNull(), + /** + * Identifier name of the attachment. + */ + name: text("name", {}).notNull(), /** * Date time at the time the attachment was last updated. */ @@ -60,10 +64,6 @@ export const eventAttachmentsTable = pgTable( onDelete: "set null", onUpdate: "cascade", }), - /** - * URI to the attachment. - */ - uri: text("uri", {}).notNull(), }, (self) => [ index().on(self.eventId), @@ -105,6 +105,6 @@ export const eventAttachmentsTableRelations = relations( export const eventAttachmentsTableInsertSchema = createInsertSchema( eventAttachmentsTable, { - uri: (schema) => schema.uri.min(1), + name: (schema) => schema.name.min(1), }, ); diff --git a/src/drizzle/tables/organizations.ts b/src/drizzle/tables/organizations.ts index 61afae9fe0a..96f35c05109 100755 --- a/src/drizzle/tables/organizations.ts +++ b/src/drizzle/tables/organizations.ts @@ -2,6 +2,7 @@ import { relations, sql } from "drizzle-orm"; import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { uuidv7 } from "uuidv7"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { iso3166Alpha2CountryCodeEnum } from "~/src/drizzle/enums/iso3166Alpha2CountryCode"; import { actionCategoriesTable } from "./actionCategories"; import { actionsTable } from "./actions"; @@ -28,9 +29,15 @@ export const organizationsTable = pgTable( */ address: text("address"), /** - * URI to the avatar of the organization. + * Mime type of the avatar of the organization. */ - avatarURI: text("avatar_uri"), + avatarMimeType: text("avatar_mime_type", { + enum: imageMimeTypeEnum.options, + }), + /** + * Primary unique identifier of the organziation's avatar. + */ + avatarName: text("avatar_name"), /** * Name of the city where organization exists in. */ @@ -205,7 +212,7 @@ export const organizationsTableInsertSchema = createInsertSchema( organizationsTable, { address: (schema) => schema.address.min(1).max(1024), - avatarURI: (schema) => schema.avatarURI.min(1), + 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), diff --git a/src/drizzle/tables/postAttachments.ts b/src/drizzle/tables/postAttachments.ts index 6e4937b98aa..7e30cb054ee 100755 --- a/src/drizzle/tables/postAttachments.ts +++ b/src/drizzle/tables/postAttachments.ts @@ -1,7 +1,7 @@ import { relations, sql } from "drizzle-orm"; import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; -import { postAttachmentTypeEnum } from "~/src/drizzle/enums/postAttachmentType"; +import { postAttachmentMimeTypeEnum } from "~/src/drizzle/enums/postAttachmentMimeType"; import { postsTable } from "./posts"; import { usersTable } from "./users"; @@ -38,11 +38,15 @@ export const postAttachmentsTable = pgTable( onUpdate: "cascade", }), /** - * Type of the attachment. + * Mime type of the attachment. */ - type: text("type", { - enum: postAttachmentTypeEnum.options, + mimeType: text("mime_type", { + enum: postAttachmentMimeTypeEnum.options, }).notNull(), + /** + * Identifier name of the attachment. + */ + name: text("name", {}).notNull(), /** * Foreign key reference to the id of the user who last updated the attachment. */ @@ -60,10 +64,6 @@ export const postAttachmentsTable = pgTable( onDelete: "set null", onUpdate: "cascade", }), - /** - * URI to the attachment. - */ - uri: text("uri", {}).notNull(), }, (self) => [ index().on(self.createdAt), @@ -105,6 +105,6 @@ export const postAttachmentsTableRelations = relations( export const postAttachmentsTableInsertSchema = createInsertSchema( postAttachmentsTable, { - uri: (schema) => schema.uri.min(1), + name: (schema) => schema.name.min(1), }, ); diff --git a/src/drizzle/tables/users.ts b/src/drizzle/tables/users.ts index 7a79475f735..7abe5d9d30f 100755 --- a/src/drizzle/tables/users.ts +++ b/src/drizzle/tables/users.ts @@ -11,6 +11,7 @@ import { } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { uuidv7 } from "uuidv7"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { iso3166Alpha2CountryCodeEnum } from "~/src/drizzle/enums/iso3166Alpha2CountryCode"; import { userEducationGradeEnum } from "~/src/drizzle/enums/userEducationGrade"; import { userEmploymentStatusEnum } from "~/src/drizzle/enums/userEmploymentStatus"; @@ -61,9 +62,15 @@ export const usersTable = pgTable( */ address: text("address"), /** - * URI to the avatar of the user. + * Mime type of the avatar of the user. */ - avatarURI: text("avatar_uri"), + avatarMimeType: text("avatar_mime_type", { + enum: imageMimeTypeEnum.options, + }), + /** + * Primary unique identifier of the user's avatar. + */ + avatarName: text("avatar_name"), /** * Date of birth of the user. */ @@ -637,7 +644,7 @@ export const usersTableRelations = relations(usersTable, ({ many, one }) => ({ export const usersTableInsertSchema = createInsertSchema(usersTable, { address: (schema) => schema.address.min(1).max(1024), - avatarURI: (schema) => schema.avatarURI.min(1), + 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), diff --git a/src/drizzle/tables/venueAttachments.ts b/src/drizzle/tables/venueAttachments.ts index da8dc46f299..1112d35d75b 100755 --- a/src/drizzle/tables/venueAttachments.ts +++ b/src/drizzle/tables/venueAttachments.ts @@ -1,7 +1,7 @@ import { relations, sql } from "drizzle-orm"; import { index, pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; -import { venueAttachmentTypeEnum } from "~/src/drizzle/enums/venueAttachmentType"; +import { venueAttachmentMimeTypeEnum } from "~/src/drizzle/enums/venueAttachmentMimeType"; import { usersTable } from "./users"; import { venuesTable } from "./venues"; @@ -29,11 +29,15 @@ export const venueAttachmentsTable = pgTable( onUpdate: "cascade", }), /** - * Type of the attachment. + * Mime type of the attachment. */ - type: text("type", { - enum: venueAttachmentTypeEnum.options, + mimeType: text("mime_type", { + enum: venueAttachmentMimeTypeEnum.options, }).notNull(), + /** + * Identifier name of the attachment. + */ + name: text("name", {}).notNull(), /** * Date time at the time the attachment was last updated. */ @@ -51,10 +55,6 @@ export const venueAttachmentsTable = pgTable( onDelete: "set null", onUpdate: "cascade", }), - /** - * URI to the attachment. - */ - uri: text("uri", {}).notNull(), /** * Foreign key reference to the id of the venue that the attachment is associated to. */ @@ -81,7 +81,7 @@ export const venueAttachmentsTableRelations = relations( creator: one(usersTable, { fields: [venueAttachmentsTable.creatorId], references: [usersTable.id], - relationName: "venue_attachments.creator_id:users.id", + relationName: "users.id:venue_attachments.creator_id", }), /** * Many to one relationship from `venue_attachments` table to `users` table. @@ -89,7 +89,7 @@ export const venueAttachmentsTableRelations = relations( updater: one(usersTable, { fields: [venueAttachmentsTable.updaterId], references: [usersTable.id], - relationName: "venue_attachments.updater_id:users.id", + relationName: "users.id:venue_attachments.updater_id", }), /** * Many to one relationship from `venue_attachments` table to `venues` table. @@ -105,6 +105,6 @@ export const venueAttachmentsTableRelations = relations( export const venueAttachmentsTableInsertSchema = createInsertSchema( venueAttachmentsTable, { - uri: (schema) => schema.uri.min(1), + name: (schema) => schema.name.min(1), }, ); diff --git a/src/envConfigSchema.ts b/src/envConfigSchema.ts index ff9f9ff65b3..7a3f921b199 100644 --- a/src/envConfigSchema.ts +++ b/src/envConfigSchema.ts @@ -60,11 +60,43 @@ export const drizzleEnvConfigSchema = Type.Object({ */ export type DrizzleEnvConfig = Static; +/** + * JSON schema of a record of minio client environment variables accessible to the talawa api at runtime. + */ +export const minioClientEnvConfigSchema = Type.Object({ + /** + * More information can be found at: {@link https://github.com/minio/minio-js?tab=readme-ov-file#initialize-minio-client} + */ + API_MINIO_ACCESS_KEY: Type.String(), + /** + * More information can be found at: {@link https://github.com/minio/minio-js?tab=readme-ov-file#initialize-minio-client} + */ + API_MINIO_END_POINT: Type.String(), + /** + * More information can be found at: {@link https://github.com/minio/minio-js?tab=readme-ov-file#initialize-minio-client} + */ + API_MINIO_PORT: Type.Number(), + /** + * More information can be found at: {@link https://github.com/minio/minio-js?tab=readme-ov-file#initialize-minio-client} + */ + API_MINIO_SECRET_KEY: Type.String(), + /** + * More information can be found at: {@link https://github.com/minio/minio-js?tab=readme-ov-file#initialize-minio-client} + */ + API_MINIO_USE_SSL: Type.Boolean(), +}); + +/** + * Type of the object containing parsed minio client configuration environment variables. + */ +export type MinioClientEnvConfig = Static; + /** * JSON schema of a record of environment variables accessible to the talawa api at runtime. */ export const envConfigSchema = Type.Composite([ drizzleEnvConfigSchema, + minioClientEnvConfigSchema, Type.Object({ /** * Email address of the user with "administrator" role that is guaranteed to exist in the postgres database at the startup time of talawa api. @@ -78,6 +110,12 @@ export const envConfigSchema = Type.Composite([ API_ADMINISTRATOR_USER_PASSWORD: Type.String({ minLength: 1, }), + /** + * Base url that is exposed to the clients for making requests to the talawa api server at runtime. + */ + API_BASE_URL: Type.String({ + minLength: 1, + }), /** * Used for providing the host of the domain on which talawa api will run. */ @@ -95,7 +133,9 @@ export const envConfigSchema = Type.Composite([ /** * Used for providing the number of milli-seconds for setting the expiry time of authentication json web tokens created by talawa api. */ - API_JWT_EXPIRES_IN: Type.Number(), + API_JWT_EXPIRES_IN: Type.Number({ + minimum: 0, + }), /** * Used for providing the secret for signing and verifying authentication json web tokens created by talawa api. */ diff --git a/src/graphql/context.ts b/src/graphql/context.ts index 12d9c10e50c..4ed58dabb21 100644 --- a/src/graphql/context.ts +++ b/src/graphql/context.ts @@ -1,6 +1,4 @@ -import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; -import type { FastifyBaseLogger } from "fastify"; -import type * as drizzleSchema from "~/src/drizzle/schema"; +import type { FastifyInstance } from "fastify"; import type { usersTable } from "~/src/drizzle/tables/users"; import type { PubSub } from "./pubsub"; @@ -42,11 +40,13 @@ export type CurrentClient = */ export type ExplicitGraphQLContext = { currentClient: CurrentClient; - drizzleClient: PostgresJsDatabase; - log: FastifyBaseLogger; + drizzleClient: FastifyInstance["drizzleClient"]; + envConfig: Pick; jwt: { sign: (payload: ExplicitAuthenticationTokenPayload) => string; }; + log: FastifyInstance["log"]; + minio: FastifyInstance["minio"]; }; /** diff --git a/src/graphql/enums/AdvertisementAttachmentType.ts b/src/graphql/enums/AdvertisementAttachmentType.ts deleted file mode 100755 index c677063f3d1..00000000000 --- a/src/graphql/enums/AdvertisementAttachmentType.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { advertisementAttachmentTypeEnum } from "~/src/drizzle/enums/advertisementAttachmentType"; -import { builder } from "~/src/graphql/builder"; - -export const AdvertisementAttachmentType = builder.enumType( - "AdvertisementAttachmentType", - { - description: "", - values: advertisementAttachmentTypeEnum.options, - }, -); diff --git a/src/graphql/enums/EventAttachmentType.ts b/src/graphql/enums/EventAttachmentType.ts deleted file mode 100644 index 7e2417ed97a..00000000000 --- a/src/graphql/enums/EventAttachmentType.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { eventAttachmentTypeEnum } from "~/src/drizzle/enums/eventAttachmentType"; -import { builder } from "~/src/graphql/builder"; - -export const EventAttachmentType = builder.enumType("EventAttachmentType", { - description: "", - values: eventAttachmentTypeEnum.options, -}); diff --git a/src/graphql/enums/PostAttachmentType.ts b/src/graphql/enums/PostAttachmentType.ts deleted file mode 100755 index a61f037f9fd..00000000000 --- a/src/graphql/enums/PostAttachmentType.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { postAttachmentTypeEnum } from "~/src/drizzle/enums/postAttachmentType"; -import { builder } from "~/src/graphql/builder"; - -export const PostAttachmentType = builder.enumType("PostAttachmentType", { - description: "", - values: postAttachmentTypeEnum.options, -}); diff --git a/src/graphql/enums/VenueAttachmentType.ts b/src/graphql/enums/VenueAttachmentType.ts deleted file mode 100644 index 3be9d02a2cf..00000000000 --- a/src/graphql/enums/VenueAttachmentType.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { venueAttachmentTypeEnum } from "~/src/drizzle/enums/venueAttachmentType"; -import { builder } from "~/src/graphql/builder"; - -export const VenueAttachmentType = builder.enumType("VenueAttachmentType", { - description: "", - values: venueAttachmentTypeEnum.options, -}); diff --git a/src/graphql/enums/index.ts b/src/graphql/enums/index.ts index a62724d16e9..0934182dae8 100644 --- a/src/graphql/enums/index.ts +++ b/src/graphql/enums/index.ts @@ -1,17 +1,13 @@ -import "./AdvertisementAttachmentType"; import "./AdvertisementType"; import "./AgendaItemType"; import "./ChatMembershipRole"; import "./CommentVoteType"; -import "./EventAttachmentType"; import "./Iso3166Alpha2CountryCode"; import "./Iso4217CurrencyCode"; import "./OrganizationMembershipRole"; -import "./PostAttachmentType"; import "./PostVoteType"; import "./UserEducationGrade"; import "./UserEmploymentStatus"; import "./UserMaritalStatus"; import "./UserNatalSex"; import "./UserRole"; -import "./VenueAttachmentType"; diff --git a/src/graphql/inputs/CreateAdvertisementAttachmentInput.ts b/src/graphql/inputs/CreateAdvertisementAttachmentInput.ts deleted file mode 100644 index 7bbded4dd21..00000000000 --- a/src/graphql/inputs/CreateAdvertisementAttachmentInput.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { z } from "zod"; -import { advertisementAttachmentsTableInsertSchema } from "~/src/drizzle/tables/advertisementAttachments"; -import { builder } from "~/src/graphql/builder"; -import { AdvertisementAttachmentType } from "~/src/graphql/enums/AdvertisementAttachmentType"; - -export const createAdvertisementAttachmentInputSchema = - advertisementAttachmentsTableInsertSchema.pick({ - uri: true, - type: true, - }); - -export const CreateAdvertisementAttachmentInput = builder - .inputRef>( - "AdvertisementAttachmentInput", - ) - .implement({ - description: "", - fields: (t) => ({ - uri: t.string({ - description: "URI to the attachment.", - required: true, - }), - type: t.field({ - description: "Type of the attachment.", - required: true, - type: AdvertisementAttachmentType, - }), - }), - }); diff --git a/src/graphql/inputs/CreateEventAttachmentInput.ts b/src/graphql/inputs/CreateEventAttachmentInput.ts deleted file mode 100644 index 35363bfdf49..00000000000 --- a/src/graphql/inputs/CreateEventAttachmentInput.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { z } from "zod"; -import { eventAttachmentsTableInsertSchema } from "~/src/drizzle/tables/eventAttachments"; -import { builder } from "~/src/graphql/builder"; -import { EventAttachmentType } from "~/src/graphql/enums/EventAttachmentType"; - -export const createEventAttachmentInputSchema = - eventAttachmentsTableInsertSchema.pick({ - uri: true, - type: true, - }); - -export const CreateEventAttachmentInput = builder - .inputRef>( - "EventAttachmentInput", - ) - .implement({ - description: "", - fields: (t) => ({ - uri: t.string({ - description: "URI to the attachment.", - required: true, - }), - type: t.field({ - description: "Type of the attachment.", - required: true, - type: EventAttachmentType, - }), - }), - }); diff --git a/src/graphql/inputs/CreatePostAttachmentInput.ts b/src/graphql/inputs/CreatePostAttachmentInput.ts deleted file mode 100644 index 4d06d3817ba..00000000000 --- a/src/graphql/inputs/CreatePostAttachmentInput.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { z } from "zod"; -import { postAttachmentsTableInsertSchema } from "~/src/drizzle/tables/postAttachments"; -import { builder } from "~/src/graphql/builder"; -import { PostAttachmentType } from "~/src/graphql/enums/PostAttachmentType"; - -export const createPostAttachmentInputSchema = - postAttachmentsTableInsertSchema.pick({ - uri: true, - type: true, - }); - -export const CreatePostAttachmentInput = builder - .inputRef>( - "PostAttachmentInput", - ) - .implement({ - description: "", - fields: (t) => ({ - uri: t.string({ - description: "URI to the attachment.", - required: true, - }), - type: t.field({ - description: "Type of the attachment.", - required: true, - type: PostAttachmentType, - }), - }), - }); diff --git a/src/graphql/inputs/CreateVenueAttachmentInput.ts b/src/graphql/inputs/CreateVenueAttachmentInput.ts deleted file mode 100644 index 7054cdece2f..00000000000 --- a/src/graphql/inputs/CreateVenueAttachmentInput.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { z } from "zod"; -import { venueAttachmentsTableInsertSchema } from "~/src/drizzle/tables/venueAttachments"; -import { builder } from "~/src/graphql/builder"; -import { VenueAttachmentType } from "~/src/graphql/enums/VenueAttachmentType"; - -export const createVenueAttachmentInputSchema = - venueAttachmentsTableInsertSchema.pick({ - uri: true, - type: true, - }); - -export const CreateVenueAttachmentInput = builder - .inputRef>( - "VenueAttachmentInput", - ) - .implement({ - description: "", - fields: (t) => ({ - uri: t.string({ - description: "URI to the attachment.", - required: true, - }), - type: t.field({ - description: "Type of the attachment.", - required: true, - type: VenueAttachmentType, - }), - }), - }); diff --git a/src/graphql/inputs/MutationCreateAdvertisementInput.ts b/src/graphql/inputs/MutationCreateAdvertisementInput.ts index f0bae110b20..b6d950ce5b7 100644 --- a/src/graphql/inputs/MutationCreateAdvertisementInput.ts +++ b/src/graphql/inputs/MutationCreateAdvertisementInput.ts @@ -1,11 +1,8 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { advertisementsTableInsertSchema } from "~/src/drizzle/tables/advertisements"; import { builder } from "~/src/graphql/builder"; import { AdvertisementType } from "~/src/graphql/enums/AdvertisementType"; -import { - CreateAdvertisementAttachmentInput, - createAdvertisementAttachmentInputSchema, -} from "./CreateAdvertisementAttachmentInput"; export const mutationCreateAdvertisementInputSchema = advertisementsTableInsertSchema @@ -18,7 +15,8 @@ export const mutationCreateAdvertisementInputSchema = type: true, }) .extend({ - attachments: createAdvertisementAttachmentInputSchema + attachments: z + .custom>() .array() .min(1) .max(20) @@ -43,7 +41,7 @@ export const MutationCreateAdvertisementInput = builder fields: (t) => ({ attachments: t.field({ description: "Attachments of the advertisement.", - type: t.listRef(CreateAdvertisementAttachmentInput), + type: t.listRef("Upload"), }), description: t.string({ description: "Custom information about the advertisement.", diff --git a/src/graphql/inputs/MutationCreateChatInput.ts b/src/graphql/inputs/MutationCreateChatInput.ts index 19c7383d2bc..0736bd1cf8f 100644 --- a/src/graphql/inputs/MutationCreateChatInput.ts +++ b/src/graphql/inputs/MutationCreateChatInput.ts @@ -1,13 +1,17 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { chatsTableInsertSchema } from "~/src/drizzle/tables/chats"; import { builder } from "~/src/graphql/builder"; -export const mutationCreateChatInputSchema = chatsTableInsertSchema.pick({ - avatarURI: true, - description: true, - name: true, - organizationId: true, -}); +export const mutationCreateChatInputSchema = chatsTableInsertSchema + .pick({ + description: true, + name: true, + organizationId: true, + }) + .extend({ + avatar: z.custom>().nullish(), + }); export const MutationCreateChatInput = builder .inputRef>( @@ -16,8 +20,9 @@ export const MutationCreateChatInput = builder .implement({ description: "", fields: (t) => ({ - avatarURI: t.string({ - description: "URI to the avatar of the chat.", + avatar: t.field({ + description: "Avatar of the chat.", + type: "Upload", }), description: t.string({ description: "Custom information about the chat.", diff --git a/src/graphql/inputs/MutationCreateEventInput.ts b/src/graphql/inputs/MutationCreateEventInput.ts index 5a506cba832..0eecc24a8b5 100644 --- a/src/graphql/inputs/MutationCreateEventInput.ts +++ b/src/graphql/inputs/MutationCreateEventInput.ts @@ -1,10 +1,7 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { eventsTableInsertSchema } from "~/src/drizzle/tables/events"; import { builder } from "~/src/graphql/builder"; -import { - CreateEventAttachmentInput, - createEventAttachmentInputSchema, -} from "./CreateEventAttachmentInput"; export const mutationCreateEventInputSchema = eventsTableInsertSchema .pick({ @@ -15,7 +12,8 @@ export const mutationCreateEventInputSchema = eventsTableInsertSchema startAt: true, }) .extend({ - attachments: createEventAttachmentInputSchema + attachments: z + .custom>() .array() .min(1) .max(20) @@ -40,7 +38,7 @@ export const MutationCreateEventInput = builder fields: (t) => ({ attachments: t.field({ description: "Attachments of the event.", - type: t.listRef(CreateEventAttachmentInput), + type: t.listRef("Upload"), }), description: t.string({ description: "Custom information about the event.", diff --git a/src/graphql/inputs/MutationCreateOrganizationInput.ts b/src/graphql/inputs/MutationCreateOrganizationInput.ts index 19b31f3c6d7..7a0b3eb713e 100644 --- a/src/graphql/inputs/MutationCreateOrganizationInput.ts +++ b/src/graphql/inputs/MutationCreateOrganizationInput.ts @@ -1,16 +1,23 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { organizationsTableInsertSchema } from "~/src/drizzle/tables/organizations"; import { builder } from "~/src/graphql/builder"; import { Iso3166Alpha2CountryCode } from "~/src/graphql/enums/Iso3166Alpha2CountryCode"; export const mutationCreateOrganizationInputSchema = - organizationsTableInsertSchema.omit({ - createdAt: true, - creatorId: true, - id: true, - updatedAt: true, - updaterId: true, - }); + organizationsTableInsertSchema + .pick({ + address: true, + city: true, + countryCode: true, + description: true, + name: true, + postalCode: true, + state: true, + }) + .extend({ + avatar: z.custom>().nullish(), + }); export const MutationCreateOrganizationInput = builder .inputRef>( @@ -22,8 +29,9 @@ export const MutationCreateOrganizationInput = builder address: t.string({ description: "Address of the organization.", }), - avatarURI: t.string({ - description: "URI to the avatar of the organization.", + avatar: t.field({ + description: "Avatar of the organization.", + type: "Upload", }), city: t.string({ description: "Name of the city where the organization resides in.", diff --git a/src/graphql/inputs/MutationCreatePostInput.ts b/src/graphql/inputs/MutationCreatePostInput.ts index f674f488af6..31650fe51d5 100644 --- a/src/graphql/inputs/MutationCreatePostInput.ts +++ b/src/graphql/inputs/MutationCreatePostInput.ts @@ -1,10 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; import { z } from "zod"; import { postsTableInsertSchema } from "~/src/drizzle/tables/posts"; import { builder } from "~/src/graphql/builder"; -import { - CreatePostAttachmentInput, - createPostAttachmentInputSchema, -} from "./CreatePostAttachmentInput"; export const mutationCreatePostInputSchema = postsTableInsertSchema .pick({ @@ -12,7 +9,8 @@ export const mutationCreatePostInputSchema = postsTableInsertSchema organizationId: true, }) .extend({ - attachments: createPostAttachmentInputSchema + attachments: z + .custom>() .array() .min(1) .max(20) @@ -29,7 +27,7 @@ export const MutationCreatePostInput = builder fields: (t) => ({ attachments: t.field({ description: "Attachments of the post.", - type: t.listRef(CreatePostAttachmentInput), + type: t.listRef("Upload"), }), caption: t.string({ description: "Caption about the post.", diff --git a/src/graphql/inputs/MutationCreateUserInput.ts b/src/graphql/inputs/MutationCreateUserInput.ts index 18c7a0a91e0..bc56ffba353 100755 --- a/src/graphql/inputs/MutationCreateUserInput.ts +++ b/src/graphql/inputs/MutationCreateUserInput.ts @@ -1,3 +1,4 @@ +import type { FileUpload } from "graphql-upload-minimal"; import { z } from "zod"; import { usersTableInsertSchema } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; @@ -10,6 +11,8 @@ import { UserRole } from "~/src/graphql/enums/UserRole"; export const mutationCreateUserInputSchema = usersTableInsertSchema .omit({ + avatarMimeType: true, + avatarName: true, createdAt: true, creatorId: true, id: true, @@ -18,6 +21,7 @@ export const mutationCreateUserInputSchema = usersTableInsertSchema updaterId: true, }) .extend({ + avatar: z.custom>().nullish(), password: z.string().min(1).max(64), }); @@ -31,8 +35,9 @@ export const MutationCreateUserInput = builder address: t.string({ description: "Address of the user.", }), - avatarURI: t.string({ - description: "URI to the avatar of the user.", + avatar: t.field({ + description: "Avatar of the user.", + type: "Upload", }), birthDate: t.field({ description: "Date of birth of the user.", diff --git a/src/graphql/inputs/MutationCreateVenueInput.ts b/src/graphql/inputs/MutationCreateVenueInput.ts index a3c217c82f2..74dbdbce5c6 100644 --- a/src/graphql/inputs/MutationCreateVenueInput.ts +++ b/src/graphql/inputs/MutationCreateVenueInput.ts @@ -1,10 +1,7 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { venuesTableInsertSchema } from "~/src/drizzle/tables/venues"; import { builder } from "~/src/graphql/builder"; -import { - CreateVenueAttachmentInput, - createVenueAttachmentInputSchema, -} from "./CreateVenueAttachmentInput"; export const mutationCreateVenueInputSchema = venuesTableInsertSchema .pick({ @@ -13,7 +10,8 @@ export const mutationCreateVenueInputSchema = venuesTableInsertSchema organizationId: true, }) .extend({ - attachments: createVenueAttachmentInputSchema + attachments: z + .custom>() .array() .min(1) .max(20) @@ -29,7 +27,7 @@ export const MutationCreateVenueInput = builder fields: (t) => ({ attachments: t.field({ description: "Attachments of the venue.", - type: t.listRef(CreateVenueAttachmentInput), + type: t.listRef("Upload"), }), description: t.string({ description: "Custom information about the venue.", diff --git a/src/graphql/inputs/MutationSignUpInput.ts b/src/graphql/inputs/MutationSignUpInput.ts index ce533973a8d..106f77e43d0 100755 --- a/src/graphql/inputs/MutationSignUpInput.ts +++ b/src/graphql/inputs/MutationSignUpInput.ts @@ -1,3 +1,4 @@ +import type { FileUpload } from "graphql-upload-minimal"; import { z } from "zod"; import { usersTableInsertSchema } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; @@ -9,6 +10,8 @@ import { UserNatalSex } from "~/src/graphql/enums/UserNatalSex"; export const mutationSignUpInputSchema = usersTableInsertSchema .omit({ + avatarMimeType: true, + avatarName: true, createdAt: true, creatorId: true, id: true, @@ -19,6 +22,7 @@ export const mutationSignUpInputSchema = usersTableInsertSchema updaterId: true, }) .extend({ + avatar: z.custom>().nullish(), confirmedPassword: z.string().min(1).max(64), password: z.string().min(1).max(64), }) @@ -47,8 +51,9 @@ export const MutationSignUpInput = builder address: t.string({ description: "Address of the user.", }), - avatarURI: t.string({ - description: "URI to the avatar of the user.", + avatar: t.field({ + description: "Avatar of the user.", + type: "Upload", }), birthDate: t.field({ description: "Date of birth of the user.", diff --git a/src/graphql/inputs/MutationUpdateChatInput.ts b/src/graphql/inputs/MutationUpdateChatInput.ts index 5f18e9efb85..4a1646246a0 100644 --- a/src/graphql/inputs/MutationUpdateChatInput.ts +++ b/src/graphql/inputs/MutationUpdateChatInput.ts @@ -1,13 +1,14 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { chatsTableInsertSchema } from "~/src/drizzle/tables/chats"; import { builder } from "~/src/graphql/builder"; export const mutationUpdateChatInputSchema = chatsTableInsertSchema .pick({ - avatarURI: true, description: true, }) .extend({ + avatar: z.custom>().nullish(), id: chatsTableInsertSchema.shape.id.unwrap(), name: chatsTableInsertSchema.shape.name.optional(), }) @@ -25,8 +26,9 @@ export const MutationUpdateChatInput = builder .implement({ description: "", fields: (t) => ({ - avatarURI: t.string({ - description: "URI to the avatar of the chat.", + avatar: t.field({ + description: "Avatar of the chat.", + type: "Upload", }), description: t.string({ description: "Custom information about the chat.", diff --git a/src/graphql/inputs/MutationUpdateCurrentUserInput.ts b/src/graphql/inputs/MutationUpdateCurrentUserInput.ts index 7ed3a0694da..cbd2a3c3e40 100755 --- a/src/graphql/inputs/MutationUpdateCurrentUserInput.ts +++ b/src/graphql/inputs/MutationUpdateCurrentUserInput.ts @@ -1,3 +1,4 @@ +import type { FileUpload } from "graphql-upload-minimal"; import { z } from "zod"; import { usersTableInsertSchema } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; @@ -9,6 +10,8 @@ import { UserNatalSex } from "~/src/graphql/enums/UserNatalSex"; export const mutationUpdateCurrentUserInputSchema = usersTableInsertSchema .omit({ + avatarMimeType: true, + avatarName: true, createdAt: true, creatorId: true, emailAddress: true, @@ -21,6 +24,7 @@ export const mutationUpdateCurrentUserInputSchema = usersTableInsertSchema updaterId: true, }) .extend({ + avatar: z.custom>().nullish(), emailAddress: usersTableInsertSchema.shape.emailAddress.optional(), name: usersTableInsertSchema.shape.name.optional(), password: z.string().min(1).max(64).optional(), @@ -39,8 +43,9 @@ export const MutationUpdateCurrentUserInput = builder address: t.string({ description: "Address of the user.", }), - avatarURI: t.string({ - description: "URI to the avatar of the user.", + avatar: t.field({ + description: "Avatar of the user.", + type: "Upload", }), birthDate: t.field({ description: "Date of birth of the user.", diff --git a/src/graphql/inputs/MutationUpdateOrganizationInput.ts b/src/graphql/inputs/MutationUpdateOrganizationInput.ts index 349c7d8cc29..4ce180b21b8 100644 --- a/src/graphql/inputs/MutationUpdateOrganizationInput.ts +++ b/src/graphql/inputs/MutationUpdateOrganizationInput.ts @@ -1,19 +1,21 @@ -import type { z } from "zod"; +import type { FileUpload } from "graphql-upload-minimal"; +import { z } from "zod"; import { organizationsTableInsertSchema } from "~/src/drizzle/tables/organizations"; import { builder } from "~/src/graphql/builder"; import { Iso3166Alpha2CountryCode } from "~/src/graphql/enums/Iso3166Alpha2CountryCode"; export const mutationUpdateOrganizationInputSchema = organizationsTableInsertSchema - .omit({ - createdAt: true, - creatorId: true, - id: true, - name: true, - updatedAt: true, - updaterId: true, + .pick({ + address: true, + city: true, + countryCode: true, + description: true, + postalCode: true, + state: true, }) .extend({ + avatar: z.custom>().nullish(), id: organizationsTableInsertSchema.shape.id.unwrap(), name: organizationsTableInsertSchema.shape.name.optional(), }) @@ -35,8 +37,9 @@ export const MutationUpdateOrganizationInput = builder address: t.string({ description: "Address of the organization.", }), - avatarURI: t.string({ - description: "URI to the avatar of the organization.", + avatar: t.field({ + description: "Avatar of the organization.", + type: "Upload", }), city: t.string({ description: "Name of the city where the organization resides in.", diff --git a/src/graphql/inputs/MutationUpdateUserInput.ts b/src/graphql/inputs/MutationUpdateUserInput.ts index 01257d0e3c1..5ef66de5c35 100755 --- a/src/graphql/inputs/MutationUpdateUserInput.ts +++ b/src/graphql/inputs/MutationUpdateUserInput.ts @@ -1,3 +1,4 @@ +import type { FileUpload } from "graphql-upload-minimal"; import { z } from "zod"; import { usersTableInsertSchema } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; @@ -10,6 +11,8 @@ import { UserRole } from "~/src/graphql/enums/UserRole"; export const mutationUpdateUserInputSchema = usersTableInsertSchema .omit({ + avatarMimeType: true, + avatarName: true, createdAt: true, creatorId: true, emailAddress: true, @@ -20,6 +23,7 @@ export const mutationUpdateUserInputSchema = usersTableInsertSchema updaterId: true, }) .extend({ + avatar: z.custom>().nullish(), emailAddress: usersTableInsertSchema.shape.emailAddress.optional(), id: usersTableInsertSchema.shape.id.unwrap(), isEmailAddressVerified: @@ -46,8 +50,9 @@ export const MutationUpdateUserInput = builder address: t.string({ description: "Address of the user.", }), - avatarURI: t.string({ - description: "URI to the avatar of the user.", + avatar: t.field({ + description: "Avatar of the user.", + type: "Upload", }), birthDate: t.field({ description: "Date of birth of the user.", diff --git a/src/graphql/inputs/index.ts b/src/graphql/inputs/index.ts index 74344b3699c..9db114a19eb 100644 --- a/src/graphql/inputs/index.ts +++ b/src/graphql/inputs/index.ts @@ -1,7 +1,3 @@ -import "./CreateAdvertisementAttachmentInput"; -import "./CreateEventAttachmentInput"; -import "./CreatePostAttachmentInput"; -import "./CreateVenueAttachmentInput"; import "./MutationCreateAdvertisementInput"; import "./MutationCreateAgendaFolderInput"; import "./MutationCreateAgendaItemInput"; diff --git a/src/graphql/scalars/Upload.ts b/src/graphql/scalars/Upload.ts new file mode 100644 index 00000000000..ab28a7aa890 --- /dev/null +++ b/src/graphql/scalars/Upload.ts @@ -0,0 +1,20 @@ +import { + type FileUpload, + GraphQLUpload as GraphQLUploadResolver, +} from "graphql-upload-minimal"; +import { builder } from "~/src/graphql/builder"; + +/** + * Must only be used for graphql argument and input type fields. More information at these links: + * 1. {@link https://github.com/mercurius-js/mercurius-upload} + * 2. {@link https://github.com/flash-oss/graphql-upload-minimal} + */ +builder.addScalarType("Upload", GraphQLUploadResolver); + +/** + * `Upload` scalar type for pothos schema. + */ +export type Upload = { + Input: Promise; + Output: Promise; +}; diff --git a/src/graphql/scalars/index.ts b/src/graphql/scalars/index.ts index ff524031c47..602206f8ee2 100644 --- a/src/graphql/scalars/index.ts +++ b/src/graphql/scalars/index.ts @@ -3,12 +3,14 @@ import "./Date"; import "./DateTime"; import "./EmailAddress"; import "./PhoneNumber"; +import "./Upload"; import type { _BigInt } from "./BigInt"; import type { _Date } from "./Date"; import type { DateTime } from "./DateTime"; import type { EmailAddress } from "./EmailAddress"; import type { PhoneNumber } from "./PhoneNumber"; +import type { Upload } from "./Upload"; /** * Map of custom scalar types used in talawa api used to annotate the type of those scalars to the pothos schema builder intiializer for type-safe usage of those scalars in the pothos schema definitions. @@ -19,6 +21,7 @@ export type CustomScalars = { DateTime: DateTime; EmailAddress: EmailAddress; PhoneNumber: PhoneNumber; + Upload: Upload; }; /** diff --git a/src/graphql/types/Advertisement/Advertisement.ts b/src/graphql/types/Advertisement/Advertisement.ts index 3dc642ab131..13ec9d30af2 100644 --- a/src/graphql/types/Advertisement/Advertisement.ts +++ b/src/graphql/types/Advertisement/Advertisement.ts @@ -38,7 +38,7 @@ Advertisement.implement({ type: "DateTime", }), type: t.expose("type", { - description: "Type of the attachment.", + description: "Mime type of the attachment.", type: AdvertisementType, }), }), diff --git a/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts b/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts index f531ec0a8aa..c95b0e37d0c 100644 --- a/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts +++ b/src/graphql/types/AdvertisementAttachment/AdvertisementAttachment.ts @@ -1,6 +1,5 @@ import type { advertisementAttachmentsTable } from "~/src/drizzle/tables/advertisementAttachments"; import { builder } from "~/src/graphql/builder"; -import { AdvertisementAttachmentType } from "~/src/graphql/enums/AdvertisementAttachmentType"; export type AdvertisementAttachment = typeof advertisementAttachmentsTable.$inferSelect; @@ -11,12 +10,8 @@ export const AdvertisementAttachment = AdvertisementAttachment.implement({ description: "", fields: (t) => ({ - type: t.expose("type", { - description: "Type of the attachment.", - type: AdvertisementAttachmentType, - }), - uri: t.exposeString("uri", { - description: "URI to the attachment.", + mimeType: t.exposeString("mimeType", { + description: "Mime type of the attachment.", }), }), }); diff --git a/src/graphql/types/AdvertisementAttachment/index.ts b/src/graphql/types/AdvertisementAttachment/index.ts index c02766c744d..df2a4717340 100644 --- a/src/graphql/types/AdvertisementAttachment/index.ts +++ b/src/graphql/types/AdvertisementAttachment/index.ts @@ -1 +1,2 @@ import "./AdvertisementAttachment"; +import "./url"; diff --git a/src/graphql/types/AdvertisementAttachment/url.ts b/src/graphql/types/AdvertisementAttachment/url.ts new file mode 100644 index 00000000000..40898cc557a --- /dev/null +++ b/src/graphql/types/AdvertisementAttachment/url.ts @@ -0,0 +1,15 @@ +import { AdvertisementAttachment } from "./AdvertisementAttachment"; + +AdvertisementAttachment.implement({ + fields: (t) => ({ + url: t.field({ + description: "URL to the attachment.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.name}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/graphql/types/AgendaFolder/createdAt.ts b/src/graphql/types/AgendaFolder/createdAt.ts index 5dedb17dea9..c128281a341 100644 --- a/src/graphql/types/AgendaFolder/createdAt.ts +++ b/src/graphql/types/AgendaFolder/createdAt.ts @@ -26,12 +26,16 @@ AgendaFolder.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.eventId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaFolder/creator.ts b/src/graphql/types/AgendaFolder/creator.ts index 76411523d54..71960377060 100644 --- a/src/graphql/types/AgendaFolder/creator.ts +++ b/src/graphql/types/AgendaFolder/creator.ts @@ -24,12 +24,16 @@ AgendaFolder.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.eventId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaFolder/event.ts b/src/graphql/types/AgendaFolder/event.ts index 4e25cfafb23..6bf667cad46 100644 --- a/src/graphql/types/AgendaFolder/event.ts +++ b/src/graphql/types/AgendaFolder/event.ts @@ -32,7 +32,9 @@ AgendaFolder.implement({ with: { eventAttachmentsWhereEvent: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaFolder/parentFolder.ts b/src/graphql/types/AgendaFolder/parentFolder.ts index 7e0bfdc0885..3e7842091d2 100644 --- a/src/graphql/types/AgendaFolder/parentFolder.ts +++ b/src/graphql/types/AgendaFolder/parentFolder.ts @@ -27,12 +27,16 @@ AgendaFolder.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.eventId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaFolder/updatedAt.ts b/src/graphql/types/AgendaFolder/updatedAt.ts index 0e99929ef13..0afabc78d05 100644 --- a/src/graphql/types/AgendaFolder/updatedAt.ts +++ b/src/graphql/types/AgendaFolder/updatedAt.ts @@ -26,12 +26,16 @@ AgendaFolder.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.eventId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaFolder/updater.ts b/src/graphql/types/AgendaFolder/updater.ts index 44fbebdabea..3f704a00798 100644 --- a/src/graphql/types/AgendaFolder/updater.ts +++ b/src/graphql/types/AgendaFolder/updater.ts @@ -24,12 +24,16 @@ AgendaFolder.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.eventId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaItem/createdAt.ts b/src/graphql/types/AgendaItem/createdAt.ts index 65f40420b9f..9fd6d441a76 100644 --- a/src/graphql/types/AgendaItem/createdAt.ts +++ b/src/graphql/types/AgendaItem/createdAt.ts @@ -26,15 +26,21 @@ AgendaItem.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.agendaFoldersTable.findFirst({ - columns: {}, + columns: { + isAgendaItemFolder: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.folderId), with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaItem/creator.ts b/src/graphql/types/AgendaItem/creator.ts index 0172cf20dc1..734794632e7 100644 --- a/src/graphql/types/AgendaItem/creator.ts +++ b/src/graphql/types/AgendaItem/creator.ts @@ -24,15 +24,21 @@ AgendaItem.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.agendaFoldersTable.findFirst({ - columns: {}, + columns: { + isAgendaItemFolder: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.folderId), with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaItem/folder.ts b/src/graphql/types/AgendaItem/folder.ts index 8331e9d75a6..a3744198d74 100644 --- a/src/graphql/types/AgendaItem/folder.ts +++ b/src/graphql/types/AgendaItem/folder.ts @@ -31,10 +31,14 @@ AgendaItem.implement({ operators.eq(fields.id, parent.folderId), with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaItem/updatedAt.ts b/src/graphql/types/AgendaItem/updatedAt.ts index 533b08fdc4a..3cf180ed32e 100644 --- a/src/graphql/types/AgendaItem/updatedAt.ts +++ b/src/graphql/types/AgendaItem/updatedAt.ts @@ -23,15 +23,21 @@ AgendaItem.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.agendaFoldersTable.findFirst({ - columns: {}, + columns: { + isAgendaItemFolder: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.folderId), with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/AgendaItem/updater.ts b/src/graphql/types/AgendaItem/updater.ts index 4ca833cb616..093479c17ce 100644 --- a/src/graphql/types/AgendaItem/updater.ts +++ b/src/graphql/types/AgendaItem/updater.ts @@ -24,15 +24,21 @@ AgendaItem.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.agendaFoldersTable.findFirst({ - columns: {}, + columns: { + isAgendaItemFolder: true, + }, where: (fields, operators) => operators.eq(fields.id, parent.folderId), with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Chat/Chat.ts b/src/graphql/types/Chat/Chat.ts index 2845d42ed34..2ac7e55f459 100644 --- a/src/graphql/types/Chat/Chat.ts +++ b/src/graphql/types/Chat/Chat.ts @@ -8,8 +8,8 @@ export const Chat = builder.objectRef("Chat"); Chat.implement({ description: "", fields: (t) => ({ - avatarURI: t.exposeString("avatarURI", { - description: "URI to the avatar of the chat.", + avatarMimeType: t.exposeString("avatarMimeType", { + description: "Mime type of the avatar of the chat.", }), description: t.exposeString("description", { description: "Custom information about the chat.", diff --git a/src/graphql/types/Chat/avatarURL.ts b/src/graphql/types/Chat/avatarURL.ts new file mode 100644 index 00000000000..93d185d9015 --- /dev/null +++ b/src/graphql/types/Chat/avatarURL.ts @@ -0,0 +1,15 @@ +import { Chat } from "./Chat"; + +Chat.implement({ + fields: (t) => ({ + avatarURL: t.field({ + description: "URL to the avatar of the chat.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.name}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/graphql/types/Chat/index.ts b/src/graphql/types/Chat/index.ts index c1aaf9521d3..67adcfe388b 100644 --- a/src/graphql/types/Chat/index.ts +++ b/src/graphql/types/Chat/index.ts @@ -1,4 +1,5 @@ import "./Chat"; +import "./avatarURL"; import "./createdAt"; import "./creator"; import "./members"; diff --git a/src/graphql/types/Comment/updater.ts b/src/graphql/types/Comment/updater.ts index 13bbee1aa27..52fcb907379 100644 --- a/src/graphql/types/Comment/updater.ts +++ b/src/graphql/types/Comment/updater.ts @@ -24,10 +24,14 @@ Comment.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.postsTable.findFirst({ - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/EventAttachment/EventAttachment.ts b/src/graphql/types/EventAttachment/EventAttachment.ts index c1f4f10e8bf..6908befc2fd 100644 --- a/src/graphql/types/EventAttachment/EventAttachment.ts +++ b/src/graphql/types/EventAttachment/EventAttachment.ts @@ -1,6 +1,5 @@ import type { eventAttachmentsTable } from "~/src/drizzle/tables/eventAttachments"; import { builder } from "~/src/graphql/builder"; -import { EventAttachmentType } from "~/src/graphql/enums/EventAttachmentType"; export type EventAttachment = typeof eventAttachmentsTable.$inferSelect; @@ -10,12 +9,8 @@ export const EventAttachment = EventAttachment.implement({ description: "", fields: (t) => ({ - type: t.expose("type", { - description: "Type of the attachment.", - type: EventAttachmentType, - }), - uri: t.exposeString("uri", { - description: "URI to the attachment.", + mimeType: t.exposeString("mimeType", { + description: "Mime type of the attachment.", }), }), }); diff --git a/src/graphql/types/EventAttachment/index.ts b/src/graphql/types/EventAttachment/index.ts index 3abe93ad591..1a431bb70c8 100644 --- a/src/graphql/types/EventAttachment/index.ts +++ b/src/graphql/types/EventAttachment/index.ts @@ -1 +1,2 @@ import "./EventAttachment"; +import "./url"; diff --git a/src/graphql/types/EventAttachment/url.ts b/src/graphql/types/EventAttachment/url.ts new file mode 100644 index 00000000000..1e1ae974c30 --- /dev/null +++ b/src/graphql/types/EventAttachment/url.ts @@ -0,0 +1,15 @@ +import { EventAttachment } from "./EventAttachment"; + +EventAttachment.implement({ + fields: (t) => ({ + url: t.field({ + description: "URL to the attachment.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.name}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/graphql/types/FundCampaign/createdAt.ts b/src/graphql/types/FundCampaign/createdAt.ts index 3fa984b4f93..ba5401cae2b 100644 --- a/src/graphql/types/FundCampaign/createdAt.ts +++ b/src/graphql/types/FundCampaign/createdAt.ts @@ -27,10 +27,14 @@ FundCampaign.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaign/creator.ts b/src/graphql/types/FundCampaign/creator.ts index f219e1a5b9a..6b9288d368d 100644 --- a/src/graphql/types/FundCampaign/creator.ts +++ b/src/graphql/types/FundCampaign/creator.ts @@ -24,10 +24,14 @@ FundCampaign.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaign/updatedAt.ts b/src/graphql/types/FundCampaign/updatedAt.ts index 59f69862b4d..99fda3d5c22 100644 --- a/src/graphql/types/FundCampaign/updatedAt.ts +++ b/src/graphql/types/FundCampaign/updatedAt.ts @@ -27,10 +27,14 @@ FundCampaign.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaign/updater.ts b/src/graphql/types/FundCampaign/updater.ts index 7b6c5e12e6d..e52ab547cf7 100644 --- a/src/graphql/types/FundCampaign/updater.ts +++ b/src/graphql/types/FundCampaign/updater.ts @@ -24,10 +24,14 @@ FundCampaign.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaignPledge/createdAt.ts b/src/graphql/types/FundCampaignPledge/createdAt.ts index 99ed373c9df..351bda71318 100644 --- a/src/graphql/types/FundCampaignPledge/createdAt.ts +++ b/src/graphql/types/FundCampaignPledge/createdAt.ts @@ -28,13 +28,19 @@ FundCampaignPledge.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaignPledge/creator.ts b/src/graphql/types/FundCampaignPledge/creator.ts index 2d9a427af17..98d5a618002 100644 --- a/src/graphql/types/FundCampaignPledge/creator.ts +++ b/src/graphql/types/FundCampaignPledge/creator.ts @@ -24,13 +24,19 @@ FundCampaignPledge.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaignPledge/pledger.ts b/src/graphql/types/FundCampaignPledge/pledger.ts index 4ce338d0878..f2222bd24ab 100644 --- a/src/graphql/types/FundCampaignPledge/pledger.ts +++ b/src/graphql/types/FundCampaignPledge/pledger.ts @@ -24,13 +24,19 @@ FundCampaignPledge.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaignPledge/updatedAt.ts b/src/graphql/types/FundCampaignPledge/updatedAt.ts index 145604eff21..d37bdaca376 100644 --- a/src/graphql/types/FundCampaignPledge/updatedAt.ts +++ b/src/graphql/types/FundCampaignPledge/updatedAt.ts @@ -27,13 +27,19 @@ FundCampaignPledge.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/FundCampaignPledge/updater.ts b/src/graphql/types/FundCampaignPledge/updater.ts index 12c9bf64bdb..12a1651b347 100644 --- a/src/graphql/types/FundCampaignPledge/updater.ts +++ b/src/graphql/types/FundCampaignPledge/updater.ts @@ -24,13 +24,19 @@ FundCampaignPledge.implement({ operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createAdvertisement.ts b/src/graphql/types/Mutation/createAdvertisement.ts index 063ba988165..262a2190b06 100644 --- a/src/graphql/types/Mutation/createAdvertisement.ts +++ b/src/graphql/types/Mutation/createAdvertisement.ts @@ -1,4 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { advertisementAttachmentMimeTypeEnum } from "~/src/drizzle/enums/advertisementAttachmentMimeType"; import { advertisementAttachmentsTable } from "~/src/drizzle/tables/advertisementAttachments"; import { advertisementsTable } from "~/src/drizzle/tables/advertisements"; import { builder } from "~/src/graphql/builder"; @@ -10,7 +13,47 @@ import { Advertisement } from "~/src/graphql/types/Advertisement/Advertisement"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateAdvertisementArgumentsSchema = z.object({ - input: mutationCreateAdvertisementInputSchema, + input: mutationCreateAdvertisementInputSchema.transform(async (arg, ctx) => { + let attachments: + | (FileUpload & { + mimetype: z.infer; + })[] + | undefined; + + if (arg.attachments !== undefined) { + const rawAttachments = await Promise.all(arg.attachments); + const { data, error, success } = advertisementAttachmentMimeTypeEnum + .array() + .safeParse(rawAttachments.map((attachment) => attachment.mimetype)); + + if (!success) { + for (const issue of error.issues) { + // `issue.path[0]` would correspond to the numeric index of the attachment within `arg.attachments` array which contains the invalid mime type. + if (typeof issue.path[0] === "number") { + ctx.addIssue({ + code: "custom", + path: ["attachments", issue.path[0]], + message: `Mime type "${rawAttachments[issue.path[0]]?.mimetype}" is not allowed.`, + }); + } + } + } else { + return { + ...arg, + attachments: rawAttachments.map((attachment, index) => + Object.assign(attachment, { + mimetype: data[index], + }), + ), + }; + } + } + + return { + ...arg, + attachments, + }; + }), }); builder.mutationField("createAdvertisement", (t) => @@ -37,7 +80,7 @@ builder.mutationField("createAdvertisement", (t) => data: parsedArgs, error, success, - } = mutationCreateAdvertisementArgumentsSchema.safeParse(args); + } = await mutationCreateAdvertisementArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -74,7 +117,9 @@ builder.mutationField("createAdvertisement", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { advertisementsWhereOrganization: { columns: { @@ -182,18 +227,34 @@ builder.mutationField("createAdvertisement", (t) => } if (parsedArgs.input.attachments !== undefined) { + const attachments = parsedArgs.input.attachments; + const createdAdvertisementAttachments = await tx .insert(advertisementAttachmentsTable) .values( - parsedArgs.input.attachments.map((attachment) => ({ + attachments.map((attachment) => ({ advertisementId: createdAdvertisement.id, creatorId: currentUserId, - type: attachment.type, - uri: attachment.uri, + mimeType: attachment.mimetype, + name: ulid(), })), ) .returning(); + Promise.all( + createdAdvertisementAttachments.map((attachment, index) => + ctx.minio.client.putObject( + ctx.minio.bucketName, + attachment.name, + attachments[index].createReadStream(), + undefined, + { + "content-type": attachment.mimeType, + }, + ), + ), + ); + return Object.assign(createdAdvertisement, { attachments: createdAdvertisementAttachments, }); diff --git a/src/graphql/types/Mutation/createAgendaFolder.ts b/src/graphql/types/Mutation/createAgendaFolder.ts index 2549093881e..fb9734426d9 100644 --- a/src/graphql/types/Mutation/createAgendaFolder.ts +++ b/src/graphql/types/Mutation/createAgendaFolder.ts @@ -62,10 +62,14 @@ builder.mutationField("createAgendaFolder", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createAgendaItem.ts b/src/graphql/types/Mutation/createAgendaItem.ts index 4ef46a44d4c..c5ee1ca6751 100644 --- a/src/graphql/types/Mutation/createAgendaItem.ts +++ b/src/graphql/types/Mutation/createAgendaItem.ts @@ -66,10 +66,14 @@ builder.mutationField("createAgendaItem", (t) => }, with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createChat.ts b/src/graphql/types/Mutation/createChat.ts index 997d7cb9df6..2ad7d98c980 100644 --- a/src/graphql/types/Mutation/createChat.ts +++ b/src/graphql/types/Mutation/createChat.ts @@ -1,4 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { chatsTable } from "~/src/drizzle/tables/chats"; import { builder } from "~/src/graphql/builder"; import { @@ -6,10 +9,43 @@ import { mutationCreateChatInputSchema, } from "~/src/graphql/inputs/MutationCreateChatInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateChatArgumentsSchema = z.object({ - input: mutationCreateChatInputSchema, + input: mutationCreateChatInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const { data, success } = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type "${rawAvatar.mimetype}" is not allowed.`, + }); + } else { + return { + ...arg, + avatar: Object.assign(rawAvatar, { + mimetype: data, + }), + }; + } + } + + return { + ...arg, + avatar, + }; + }), }); builder.mutationField("createChat", (t) => @@ -36,7 +72,7 @@ builder.mutationField("createChat", (t) => data: parsedArgs, error, success, - } = mutationCreateChatArgumentsSchema.safeParse(args); + } = await mutationCreateChatArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -61,7 +97,9 @@ builder.mutationField("createChat", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -121,31 +159,54 @@ builder.mutationField("createChat", (t) => }); } - const [createdChat] = await ctx.drizzleClient - .insert(chatsTable) - .values({ - avatarURI: parsedArgs.input.avatarURI, - creatorId: currentUserId, - description: parsedArgs.input.description, - name: parsedArgs.input.name, - organizationId: parsedArgs.input.organizationId, - }) - .returning(); - - // Inserted chat not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. - if (createdChat === undefined) { - ctx.log.error( - "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", - ); - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = ulid(); + avatarMimeType = parsedArgs.input.avatar.mimetype; } - return createdChat; + return await ctx.drizzleClient.transaction(async (tx) => { + const [createdChat] = await tx + .insert(chatsTable) + .values({ + avatarMimeType, + avatarName, + creatorId: currentUserId, + description: parsedArgs.input.description, + name: parsedArgs.input.name, + organizationId: parsedArgs.input.organizationId, + }) + .returning(); + + // Inserted chat not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. + if (createdChat === undefined) { + ctx.log.error( + "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", + ); + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } + + return createdChat; + }); }, type: Chat, }), diff --git a/src/graphql/types/Mutation/createChatMembership.ts b/src/graphql/types/Mutation/createChatMembership.ts index 1227823921a..7e39704f0f6 100644 --- a/src/graphql/types/Mutation/createChatMembership.ts +++ b/src/graphql/types/Mutation/createChatMembership.ts @@ -71,7 +71,9 @@ builder.mutationField("createChatMembership", (t) => operators.eq(fields.memberId, parsedArgs.input.memberId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createChatMessage.ts b/src/graphql/types/Mutation/createChatMessage.ts index 3b94bbd7619..73a58a032f4 100644 --- a/src/graphql/types/Mutation/createChatMessage.ts +++ b/src/graphql/types/Mutation/createChatMessage.ts @@ -61,15 +61,21 @@ builder.mutationField("createChatMessage", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.chatsTable.findFirst({ - columns: {}, + columns: { + avatarMimeType: true, + }, with: { chatMembershipsWhereChat: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -114,7 +120,9 @@ builder.mutationField("createChatMessage", (t) => const existingChatMessage = await ctx.drizzleClient.query.chatMessagesTable.findFirst({ - columns: {}, + columns: { + updatedAt: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.chatId, parsedArgs.input.chatId), diff --git a/src/graphql/types/Mutation/createComment.ts b/src/graphql/types/Mutation/createComment.ts index a9387682efc..1f8f53f737a 100644 --- a/src/graphql/types/Mutation/createComment.ts +++ b/src/graphql/types/Mutation/createComment.ts @@ -61,10 +61,14 @@ builder.mutationField("createComment", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.postsTable.findFirst({ - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createCommentVote.ts b/src/graphql/types/Mutation/createCommentVote.ts index acb97b70073..7a4b1845e9b 100644 --- a/src/graphql/types/Mutation/createCommentVote.ts +++ b/src/graphql/types/Mutation/createCommentVote.ts @@ -65,10 +65,14 @@ builder.mutationField("createCommentVote", (t) => ctx.drizzleClient.query.commentsTable.findFirst({ with: { post: { - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createEvent.ts b/src/graphql/types/Mutation/createEvent.ts index c502d4d33f6..ce3953fc2a0 100644 --- a/src/graphql/types/Mutation/createEvent.ts +++ b/src/graphql/types/Mutation/createEvent.ts @@ -1,4 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { eventAttachmentMimeTypeEnum } from "~/src/drizzle/enums/eventAttachmentMimeType"; import { eventAttachmentsTable } from "~/src/drizzle/tables/eventAttachments"; import { eventsTable } from "~/src/drizzle/tables/events"; import { builder } from "~/src/graphql/builder"; @@ -10,7 +13,47 @@ import { Event } from "~/src/graphql/types/Event/Event"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateEventArgumentsSchema = z.object({ - input: mutationCreateEventInputSchema, + input: mutationCreateEventInputSchema.transform(async (arg, ctx) => { + let attachments: + | (FileUpload & { + mimetype: z.infer; + })[] + | undefined; + + if (arg.attachments !== undefined) { + const rawAttachments = await Promise.all(arg.attachments); + const { data, error, success } = eventAttachmentMimeTypeEnum + .array() + .safeParse(rawAttachments.map((attachment) => attachment.mimetype)); + + if (!success) { + for (const issue of error.issues) { + // `issue.path[0]` would correspond to the numeric index of the attachment within `arg.attachments` array which contains the invalid mime type. + if (typeof issue.path[0] === "number") { + ctx.addIssue({ + code: "custom", + path: ["attachments", issue.path[0]], + message: `Mime type "${rawAttachments[issue.path[0]]?.mimetype}" is not allowed.`, + }); + } + } + } else { + return { + ...arg, + attachments: rawAttachments.map((attachment, index) => + Object.assign(attachment, { + mimetype: data[index], + }), + ), + }; + } + } + + return { + ...arg, + attachments, + }; + }), }); builder.mutationField("createEvent", (t) => @@ -37,7 +80,7 @@ builder.mutationField("createEvent", (t) => data: parsedArgs, error, success, - } = mutationCreateEventArgumentsSchema.safeParse(args); + } = await mutationCreateEventArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -62,7 +105,9 @@ builder.mutationField("createEvent", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -150,18 +195,34 @@ builder.mutationField("createEvent", (t) => } if (parsedArgs.input.attachments !== undefined) { + const attachments = parsedArgs.input.attachments; + const createdEventAttachments = await tx .insert(eventAttachmentsTable) .values( - parsedArgs.input.attachments.map((attachment) => ({ + attachments.map((attachment) => ({ creatorId: currentUserId, eventId: createdEvent.id, - type: attachment.type, - uri: attachment.uri, + mimeType: attachment.mimetype, + name: ulid(), })), ) .returning(); + Promise.all( + createdEventAttachments.map((attachment, index) => + ctx.minio.client.putObject( + ctx.minio.bucketName, + attachment.name, + attachments[index].createReadStream(), + undefined, + { + "content-type": attachment.mimeType, + }, + ), + ), + ); + return Object.assign(createdEvent, { attachments: createdEventAttachments, }); diff --git a/src/graphql/types/Mutation/createFund.ts b/src/graphql/types/Mutation/createFund.ts index eb9786a2591..a1053330abe 100644 --- a/src/graphql/types/Mutation/createFund.ts +++ b/src/graphql/types/Mutation/createFund.ts @@ -61,10 +61,14 @@ builder.mutationField("createFund", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { fundsWhereOrganization: { - columns: {}, + columns: { + isTaxDeductible: true, + }, where: (fields, operators) => operators.eq(fields.name, parsedArgs.input.name), }, diff --git a/src/graphql/types/Mutation/createFundCampaign.ts b/src/graphql/types/Mutation/createFundCampaign.ts index 0738f466aff..59a7d362a91 100644 --- a/src/graphql/types/Mutation/createFundCampaign.ts +++ b/src/graphql/types/Mutation/createFundCampaign.ts @@ -61,15 +61,21 @@ builder.mutationField("createFundCampaign", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { fundCampaignsWhereFund: { - columns: {}, + columns: { + currencyCode: true, + }, where: (fields, operators) => operators.eq(fields.name, parsedArgs.input.name), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createFundCampaignPledge.ts b/src/graphql/types/Mutation/createFundCampaignPledge.ts index f137d39bbec..839324d25e0 100644 --- a/src/graphql/types/Mutation/createFundCampaignPledge.ts +++ b/src/graphql/types/Mutation/createFundCampaignPledge.ts @@ -74,10 +74,14 @@ builder.mutationField("createFundCampaignPledge", (t) => operators.eq(fields.pledgerId, parsedArgs.input.pledgerId), }, fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -99,7 +103,9 @@ builder.mutationField("createFundCampaignPledge", (t) => operators.eq(fields.id, parsedArgs.input.campaignId), }), ctx.drizzleClient.query.usersTable.findFirst({ - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.pledgerId), }), diff --git a/src/graphql/types/Mutation/createOrganization.ts b/src/graphql/types/Mutation/createOrganization.ts index d158377a58b..dbd874db44b 100644 --- a/src/graphql/types/Mutation/createOrganization.ts +++ b/src/graphql/types/Mutation/createOrganization.ts @@ -1,4 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { organizationsTable } from "~/src/drizzle/tables/organizations"; import { builder } from "~/src/graphql/builder"; import { @@ -6,10 +9,43 @@ import { mutationCreateOrganizationInputSchema, } from "~/src/graphql/inputs/MutationCreateOrganizationInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateOrganizationArgumentsSchema = z.object({ - input: mutationCreateOrganizationInputSchema, + input: mutationCreateOrganizationInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const { data, success } = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type "${rawAvatar.mimetype}" is not allowed.`, + }); + } else { + return { + ...arg, + avatar: Object.assign(rawAvatar, { + mimetype: data, + }), + }; + } + } + + return { + ...arg, + avatar, + }; + }), }); builder.mutationField("createOrganization", (t) => @@ -36,7 +72,7 @@ builder.mutationField("createOrganization", (t) => data: parsedArgs, error, success, - } = mutationCreateOrganizationArgumentsSchema.safeParse(args); + } = await mutationCreateOrganizationArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -100,35 +136,59 @@ builder.mutationField("createOrganization", (t) => }); } - const [createdOrganization] = await ctx.drizzleClient - .insert(organizationsTable) - .values({ - address: parsedArgs.input.address, - avatarURI: parsedArgs.input.avatarURI, - city: parsedArgs.input.city, - countryCode: parsedArgs.input.countryCode, - description: parsedArgs.input.description, - creatorId: currentUserId, - name: parsedArgs.input.name, - postalCode: parsedArgs.input.postalCode, - state: parsedArgs.input.state, - }) - .returning(); - - // Inserted organization not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. - if (createdOrganization === undefined) { - ctx.log.error( - "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", - ); - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = ulid(); + avatarMimeType = parsedArgs.input.avatar.mimetype; } - return createdOrganization; + return await ctx.drizzleClient.transaction(async (tx) => { + const [createdOrganization] = await tx + .insert(organizationsTable) + .values({ + address: parsedArgs.input.address, + avatarMimeType, + avatarName, + city: parsedArgs.input.city, + countryCode: parsedArgs.input.countryCode, + description: parsedArgs.input.description, + creatorId: currentUserId, + name: parsedArgs.input.name, + postalCode: parsedArgs.input.postalCode, + state: parsedArgs.input.state, + }) + .returning(); + + // Inserted organization not being returned is an external defect unrelated to this code. It is very unlikely for this error to occur. + if (createdOrganization === undefined) { + ctx.log.error( + "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", + ); + + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } + + return createdOrganization; + }); }, type: Organization, }), diff --git a/src/graphql/types/Mutation/createPost.ts b/src/graphql/types/Mutation/createPost.ts index bc9714e2940..148959766df 100644 --- a/src/graphql/types/Mutation/createPost.ts +++ b/src/graphql/types/Mutation/createPost.ts @@ -1,4 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { postAttachmentMimeTypeEnum } from "~/src/drizzle/enums/postAttachmentMimeType"; import { postAttachmentsTable } from "~/src/drizzle/tables/postAttachments"; import { postsTable } from "~/src/drizzle/tables/posts"; import { builder } from "~/src/graphql/builder"; @@ -11,7 +14,47 @@ import { getKeyPathsWithNonUndefinedValues } from "~/src/utilities/getKeyPathsWi import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreatePostArgumentsSchema = z.object({ - input: mutationCreatePostInputSchema, + input: mutationCreatePostInputSchema.transform(async (arg, ctx) => { + let attachments: + | (FileUpload & { + mimetype: z.infer; + })[] + | undefined; + + if (arg.attachments !== undefined) { + const rawAttachments = await Promise.all(arg.attachments); + const { data, error, success } = postAttachmentMimeTypeEnum + .array() + .safeParse(rawAttachments.map((attachment) => attachment.mimetype)); + + if (!success) { + for (const issue of error.issues) { + // `issue.path[0]` would correspond to the numeric index of the attachment within `arg.attachments` array which contains the invalid mime type. + if (typeof issue.path[0] === "number") { + ctx.addIssue({ + code: "custom", + path: ["attachments", issue.path[0]], + message: `Mime type "${rawAttachments[issue.path[0]]?.mimetype}" is not allowed.`, + }); + } + } + } else { + return { + ...arg, + attachments: rawAttachments.map((attachment, index) => + Object.assign(attachment, { + mimetype: data[index], + }), + ), + }; + } + } + + return { + ...arg, + attachments, + }; + }), }); builder.mutationField("createPost", (t) => @@ -38,7 +81,7 @@ builder.mutationField("createPost", (t) => data: parsedArgs, error, success, - } = mutationCreatePostArgumentsSchema.safeParse(args); + } = await mutationCreatePostArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -63,7 +106,9 @@ builder.mutationField("createPost", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -170,18 +215,34 @@ builder.mutationField("createPost", (t) => } if (parsedArgs.input.attachments !== undefined) { + const attachments = parsedArgs.input.attachments; + const createdPostAttachments = await tx .insert(postAttachmentsTable) .values( - parsedArgs.input.attachments.map((attachment) => ({ + attachments.map((attachment) => ({ creatorId: currentUserId, + mimeType: attachment.mimetype, + name: ulid(), postId: createdPost.id, - type: attachment.type, - uri: attachment.uri, })), ) .returning(); + Promise.all( + createdPostAttachments.map((attachment, index) => + ctx.minio.client.putObject( + ctx.minio.bucketName, + attachment.name, + attachments[index].createReadStream(), + undefined, + { + "content-type": attachment.mimeType, + }, + ), + ), + ); + return Object.assign(createdPost, { attachments: createdPostAttachments, }); diff --git a/src/graphql/types/Mutation/createPostVote.ts b/src/graphql/types/Mutation/createPostVote.ts index 08f0e47d469..b7402030b6a 100644 --- a/src/graphql/types/Mutation/createPostVote.ts +++ b/src/graphql/types/Mutation/createPostVote.ts @@ -63,7 +63,9 @@ builder.mutationField("createPostVote", (t) => ctx.drizzleClient.query.postsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -80,7 +82,9 @@ builder.mutationField("createPostVote", (t) => operators.eq(fields.id, parsedArgs.input.postId), }), ctx.drizzleClient.query.postVotesTable.findFirst({ - columns: {}, + columns: { + type: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.creatorId, currentUserId), diff --git a/src/graphql/types/Mutation/createTag.ts b/src/graphql/types/Mutation/createTag.ts index 95b0b80b11d..1cc8b09cfc8 100644 --- a/src/graphql/types/Mutation/createTag.ts +++ b/src/graphql/types/Mutation/createTag.ts @@ -62,7 +62,9 @@ builder.mutationField("createTag", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -72,7 +74,9 @@ builder.mutationField("createTag", (t) => operators.eq(fields.memberId, currentUserId), }, tagsWhereOrganization: { - columns: {}, + columns: { + updaterId: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.name, parsedArgs.input.name), diff --git a/src/graphql/types/Mutation/createTagFolder.ts b/src/graphql/types/Mutation/createTagFolder.ts index b3dc9247895..072bca15d05 100644 --- a/src/graphql/types/Mutation/createTagFolder.ts +++ b/src/graphql/types/Mutation/createTagFolder.ts @@ -62,7 +62,9 @@ builder.mutationField("createTagFolder", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/createUser.ts b/src/graphql/types/Mutation/createUser.ts index 9633f99b7bc..4bdcfc73a1c 100755 --- a/src/graphql/types/Mutation/createUser.ts +++ b/src/graphql/types/Mutation/createUser.ts @@ -1,5 +1,8 @@ import { hash } from "@node-rs/argon2"; +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { usersTable } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; import { @@ -7,10 +10,43 @@ import { mutationCreateUserInputSchema, } from "~/src/graphql/inputs/MutationCreateUserInput"; import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateUserArgumentsSchema = z.object({ - input: mutationCreateUserInputSchema, + input: mutationCreateUserInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const { data, success } = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type "${rawAvatar.mimetype}" is not allowed.`, + }); + } else { + return { + ...arg, + avatar: Object.assign(rawAvatar, { + mimetype: data, + }), + }; + } + } + + return { + ...arg, + avatar, + }; + }), }); builder.mutationField("createUser", (t) => @@ -37,7 +73,7 @@ builder.mutationField("createUser", (t) => data: parsedArgs, error, success, - } = mutationCreateUserArgumentsSchema.safeParse(args); + } = await mutationCreateUserArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -54,12 +90,21 @@ builder.mutationField("createUser", (t) => 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), - }); + const [currentUser, existingUserWithEmailAddress] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq(fields.emailAddress, parsedArgs.input.emailAddress), + }), + ]); if (currentUser === undefined) { throw new TalawaGraphQLError({ @@ -79,15 +124,6 @@ builder.mutationField("createUser", (t) => }); } - const existingUserWithEmailAddress = - await ctx.drizzleClient.query.usersTable.findFirst({ - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq(fields.emailAddress, parsedArgs.input.emailAddress), - }); - if (existingUserWithEmailAddress !== undefined) { throw new TalawaGraphQLError({ extensions: { @@ -104,36 +140,78 @@ builder.mutationField("createUser", (t) => }); } - const [createdUser] = await ctx.drizzleClient - .insert(usersTable) - .values({ - ...parsedArgs.input, - creatorId: currentUserId, - passwordHash: await hash(parsedArgs.input.password), - }) - .returning(); - - // Inserted user not being returned is a external defect unrelated to this code. It is very unlikely for this error to occur. - if (createdUser === undefined) { - ctx.log.error( - "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", - ); - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = ulid(); + avatarMimeType = parsedArgs.input.avatar.mimetype; } - return { - authenticationToken: ctx.jwt.sign({ - user: { - id: createdUser.id, - }, - }), - user: createdUser, - }; + return await ctx.drizzleClient.transaction(async (tx) => { + const [createdUser] = await tx + .insert(usersTable) + .values({ + address: parsedArgs.input.address, + avatarMimeType, + avatarName, + birthDate: parsedArgs.input.birthDate, + city: parsedArgs.input.city, + countryCode: parsedArgs.input.countryCode, + creatorId: currentUserId, + description: parsedArgs.input.description, + educationGrade: parsedArgs.input.educationGrade, + emailAddress: parsedArgs.input.emailAddress, + employmentStatus: parsedArgs.input.employmentStatus, + homePhoneNumber: parsedArgs.input.homePhoneNumber, + isEmailAddressVerified: parsedArgs.input.isEmailAddressVerified, + maritalStatus: parsedArgs.input.maritalStatus, + mobilePhoneNumber: parsedArgs.input.mobilePhoneNumber, + name: parsedArgs.input.name, + natalSex: parsedArgs.input.natalSex, + passwordHash: await hash(parsedArgs.input.password), + postalCode: parsedArgs.input.postalCode, + role: parsedArgs.input.role, + state: parsedArgs.input.state, + workPhoneNumber: parsedArgs.input.workPhoneNumber, + }) + .returning(); + + // Inserted user not being returned is a external defect unrelated to this code. It is very unlikely for this error to occur. + if (createdUser === undefined) { + ctx.log.error( + "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", + ); + + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } + + return { + authenticationToken: ctx.jwt.sign({ + user: { + id: createdUser.id, + }, + }), + user: createdUser, + }; + }); }, type: AuthenticationPayload, }), diff --git a/src/graphql/types/Mutation/createVenue.ts b/src/graphql/types/Mutation/createVenue.ts index 404bc9a8f99..89b6ac0c28e 100644 --- a/src/graphql/types/Mutation/createVenue.ts +++ b/src/graphql/types/Mutation/createVenue.ts @@ -1,4 +1,7 @@ +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { venueAttachmentMimeTypeEnum } from "~/src/drizzle/enums/venueAttachmentMimeType"; import { venueAttachmentsTable } from "~/src/drizzle/tables/venueAttachments"; import { venuesTable } from "~/src/drizzle/tables/venues"; import { builder } from "~/src/graphql/builder"; @@ -10,7 +13,47 @@ import { Venue } from "~/src/graphql/types/Venue/Venue"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationCreateVenueArgumentsSchema = z.object({ - input: mutationCreateVenueInputSchema, + input: mutationCreateVenueInputSchema.transform(async (arg, ctx) => { + let attachments: + | (FileUpload & { + mimetype: z.infer; + })[] + | undefined; + + if (arg.attachments !== undefined) { + const rawAttachments = await Promise.all(arg.attachments); + const { data, error, success } = venueAttachmentMimeTypeEnum + .array() + .safeParse(rawAttachments.map((attachment) => attachment.mimetype)); + + if (!success) { + for (const issue of error.issues) { + // `issue.path[0]` would correspond to the numeric index of the attachment within `arg.attachments` array which contains the invalid mime type. + if (typeof issue.path[0] === "number") { + ctx.addIssue({ + code: "custom", + path: ["attachments", issue.path[0]], + message: `Mime type "${rawAttachments[issue.path[0]]?.mimetype}" is not allowed.`, + }); + } + } + } else { + return { + ...arg, + attachments: rawAttachments.map((attachment, index) => + Object.assign(attachment, { + mimetype: data[index], + }), + ), + }; + } + } + + return { + ...arg, + attachments, + }; + }), }); builder.mutationField("createVenue", (t) => @@ -37,7 +80,7 @@ builder.mutationField("createVenue", (t) => data: parsedArgs, error, success, - } = mutationCreateVenueArgumentsSchema.safeParse(args); + } = await mutationCreateVenueArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -62,7 +105,9 @@ builder.mutationField("createVenue", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.organizationsTable.findFirst({ - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -72,7 +117,9 @@ builder.mutationField("createVenue", (t) => operators.eq(fields.memberId, currentUserId), }, venuesWhereOrganization: { - columns: {}, + columns: { + updaterId: true, + }, where: (fields, operators) => operators.eq(fields.name, parsedArgs.input.name), }, @@ -146,7 +193,7 @@ builder.mutationField("createVenue", (t) => }); } - return ctx.drizzleClient.transaction(async (tx) => { + return await ctx.drizzleClient.transaction(async (tx) => { const [createdVenue] = await tx .insert(venuesTable) .values({ @@ -172,18 +219,34 @@ builder.mutationField("createVenue", (t) => } if (parsedArgs.input.attachments !== undefined) { + const attachments = parsedArgs.input.attachments; + const createdVenueAttachments = await tx .insert(venueAttachmentsTable) .values( - parsedArgs.input.attachments.map((attachment) => ({ + attachments.map((attachment) => ({ creatorId: currentUserId, - type: attachment.type, - uri: attachment.uri, + mimeType: attachment.mimetype, + name: ulid(), venueId: createdVenue.id, })), ) .returning(); + Promise.all( + createdVenueAttachments.map((attachment, index) => + ctx.minio.client.putObject( + ctx.minio.bucketName, + attachment.name, + attachments[index].createReadStream(), + undefined, + { + "content-type": attachment.mimeType, + }, + ), + ), + ); + return Object.assign(createdVenue, { attachments: createdVenueAttachments, }); diff --git a/src/graphql/types/Mutation/createVenueBooking.ts b/src/graphql/types/Mutation/createVenueBooking.ts index 2925eb174e2..fea13fd8023 100644 --- a/src/graphql/types/Mutation/createVenueBooking.ts +++ b/src/graphql/types/Mutation/createVenueBooking.ts @@ -61,7 +61,9 @@ builder.mutationField("createVenueBooking", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.eventId), }), @@ -70,7 +72,9 @@ builder.mutationField("createVenueBooking", (t) => operators.eq(fields.id, parsedArgs.input.venueId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -82,7 +86,9 @@ builder.mutationField("createVenueBooking", (t) => }, }, venueBookingsWhereVenue: { - columns: {}, + columns: { + creatorId: true, + }, where: (fields, operators) => operators.eq(fields.eventId, parsedArgs.input.eventId), }, diff --git a/src/graphql/types/Mutation/deleteAdvertisement.ts b/src/graphql/types/Mutation/deleteAdvertisement.ts index 474f262daa7..b7a25854674 100644 --- a/src/graphql/types/Mutation/deleteAdvertisement.ts +++ b/src/graphql/types/Mutation/deleteAdvertisement.ts @@ -62,11 +62,15 @@ builder.mutationField("deleteAdvertisement", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.advertisementsTable.findFirst({ - columns: {}, + columns: { + type: true, + }, with: { advertisementAttachmentsWhereAdvertisement: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -129,24 +133,33 @@ builder.mutationField("deleteAdvertisement", (t) => }); } - const [deletedAdvertisement] = await ctx.drizzleClient - .delete(advertisementsTable) - .where(eq(advertisementsTable.id, parsedArgs.input.id)) - .returning(); + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedAdvertisement] = await tx + .delete(advertisementsTable) + .where(eq(advertisementsTable.id, parsedArgs.input.id)) + .returning(); - // Deleted advertisement not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation. - if (deletedAdvertisement === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); - } + // Deleted advertisement not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation. + if (deletedAdvertisement === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } - return Object.assign(deletedAdvertisement, { - attachments: - existingAdvertisement.advertisementAttachmentsWhereAdvertisement, + await ctx.minio.client.removeObjects( + ctx.minio.bucketName, + existingAdvertisement.advertisementAttachmentsWhereAdvertisement.map( + (attachment) => attachment.name, + ), + ); + + return Object.assign(deletedAdvertisement, { + attachments: + existingAdvertisement.advertisementAttachmentsWhereAdvertisement, + }); }); }, type: Advertisement, diff --git a/src/graphql/types/Mutation/deleteAgendaFolder.ts b/src/graphql/types/Mutation/deleteAgendaFolder.ts index 98546114dfd..dacf23d2c19 100644 --- a/src/graphql/types/Mutation/deleteAgendaFolder.ts +++ b/src/graphql/types/Mutation/deleteAgendaFolder.ts @@ -62,13 +62,19 @@ builder.mutationField("deleteAgendaFolder", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.agendaFoldersTable.findFirst({ - columns: {}, + columns: { + isAgendaItemFolder: true, + }, with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteAgendaItem.ts b/src/graphql/types/Mutation/deleteAgendaItem.ts index 1c146674a7e..cced2b4c62d 100644 --- a/src/graphql/types/Mutation/deleteAgendaItem.ts +++ b/src/graphql/types/Mutation/deleteAgendaItem.ts @@ -62,16 +62,24 @@ builder.mutationField("deleteAgendaItem", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.agendaItemsTable.findFirst({ - columns: {}, + columns: { + type: true, + }, with: { folder: { - columns: {}, + columns: { + isAgendaItemFolder: true, + }, with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteChat.ts b/src/graphql/types/Mutation/deleteChat.ts index 63229d97497..7bc5c08a4da 100644 --- a/src/graphql/types/Mutation/deleteChat.ts +++ b/src/graphql/types/Mutation/deleteChat.ts @@ -62,7 +62,9 @@ builder.mutationField("deleteChat", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.chatsTable.findFirst({ - columns: {}, + columns: { + avatarName: true, + }, with: { chatMembershipsWhereChat: { columns: { @@ -72,7 +74,9 @@ builder.mutationField("deleteChat", (t) => operators.eq(fields.memberId, currentUserId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -138,22 +142,31 @@ builder.mutationField("deleteChat", (t) => }); } - const [deletedChat] = await ctx.drizzleClient - .delete(chatsTable) - .where(eq(chatsTable.id, parsedArgs.input.id)) - .returning(); + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedChat] = await tx + .delete(chatsTable) + .where(eq(chatsTable.id, parsedArgs.input.id)) + .returning(); - // Deleted chat not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation could take place. - if (deletedChat === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); - } + // Deleted chat not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation could take place. + if (deletedChat === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + if (existingChat.avatarName !== null) { + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + existingChat.avatarName, + ); + } - return deletedChat; + return deletedChat; + }); }, type: Chat, }), diff --git a/src/graphql/types/Mutation/deleteChatMembership.ts b/src/graphql/types/Mutation/deleteChatMembership.ts index 829a7e44235..b2c06e9cacd 100644 --- a/src/graphql/types/Mutation/deleteChatMembership.ts +++ b/src/graphql/types/Mutation/deleteChatMembership.ts @@ -75,7 +75,9 @@ builder.mutationField("deleteChatMembership", (t) => ]), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -91,7 +93,9 @@ builder.mutationField("deleteChatMembership", (t) => operators.eq(fields.id, parsedArgs.input.chatId), }), ctx.drizzleClient.query.usersTable.findFirst({ - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.memberId), }), diff --git a/src/graphql/types/Mutation/deleteChatMessage.ts b/src/graphql/types/Mutation/deleteChatMessage.ts index e9864119c4a..382fe3b96ad 100644 --- a/src/graphql/types/Mutation/deleteChatMessage.ts +++ b/src/graphql/types/Mutation/deleteChatMessage.ts @@ -67,7 +67,9 @@ builder.mutationField("deleteChatMessage", (t) => }, with: { chat: { - columns: {}, + columns: { + avatarMimeType: true, + }, with: { chatMembershipsWhereChat: { columns: { @@ -77,7 +79,9 @@ builder.mutationField("deleteChatMessage", (t) => operators.eq(fields.memberId, currentUserId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteComment.ts b/src/graphql/types/Mutation/deleteComment.ts index 9fffe3a23ea..c129495b6d9 100644 --- a/src/graphql/types/Mutation/deleteComment.ts +++ b/src/graphql/types/Mutation/deleteComment.ts @@ -67,10 +67,14 @@ builder.mutationField("deleteComment", (t) => }, with: { post: { - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteCommentVote.ts b/src/graphql/types/Mutation/deleteCommentVote.ts index 28829682896..0add1e34382 100644 --- a/src/graphql/types/Mutation/deleteCommentVote.ts +++ b/src/graphql/types/Mutation/deleteCommentVote.ts @@ -69,10 +69,14 @@ builder.mutationField("deleteCommentVote", (t) => ctx.drizzleClient.query.commentsTable.findFirst({ with: { post: { - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteCurrentUser.ts b/src/graphql/types/Mutation/deleteCurrentUser.ts index a83b343a464..3cf46bc6abb 100755 --- a/src/graphql/types/Mutation/deleteCurrentUser.ts +++ b/src/graphql/types/Mutation/deleteCurrentUser.ts @@ -17,13 +17,16 @@ builder.mutationField("deleteCurrentUser", (t) => }); } - const [deletedCurrentUser] = await ctx.drizzleClient - .delete(usersTable) - .where(eq(usersTable.id, ctx.currentClient.user.id)) - .returning(); + const currentUserId = ctx.currentClient.user.id; - // Deleted user not being returned means that either it was deleted or its `id` column was changed by an external entity before this update operation which correspondingly means that the current client is using an invalid authentication token which hasn't expired yet. - if (deletedCurrentUser === undefined) { + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + avatarName: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { throw new TalawaGraphQLError({ extensions: { code: "unauthenticated", @@ -32,7 +35,31 @@ builder.mutationField("deleteCurrentUser", (t) => }); } - return deletedCurrentUser; + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedCurrentUser] = await tx + .delete(usersTable) + .where(eq(usersTable.id, currentUserId)) + .returning(); + + // Deleted user not being returned means that either it was deleted or its `id` column was changed by an external entity before this update operation which correspondingly means that the current client is using an invalid authentication token which hasn't expired yet. + if (deletedCurrentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + message: "Only authenticated users can perform this action.", + }); + } + + if (currentUser.avatarName !== null) { + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + currentUser.avatarName, + ); + } + + return deletedCurrentUser; + }); }, type: User, }), diff --git a/src/graphql/types/Mutation/deleteEvent.ts b/src/graphql/types/Mutation/deleteEvent.ts index a54a6e0e3ab..880eb288e5a 100644 --- a/src/graphql/types/Mutation/deleteEvent.ts +++ b/src/graphql/types/Mutation/deleteEvent.ts @@ -62,11 +62,15 @@ builder.mutationField("deleteEvent", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, with: { eventAttachmentsWhereEvent: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -128,23 +132,32 @@ builder.mutationField("deleteEvent", (t) => }); } - const [deletedEvent] = await ctx.drizzleClient - .delete(eventsTable) - .where(eq(eventsTable.id, parsedArgs.input.id)) - .returning(); + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedEvent] = await tx + .delete(eventsTable) + .where(eq(eventsTable.id, parsedArgs.input.id)) + .returning(); - // Deleted event not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation could take place. - if (deletedEvent === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); - } + // Deleted event not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation could take place. + if (deletedEvent === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } - return Object.assign(deletedEvent, { - attachments: existingEvent.eventAttachmentsWhereEvent, + await ctx.minio.client.removeObjects( + ctx.minio.bucketName, + existingEvent.eventAttachmentsWhereEvent.map( + (attachment) => attachment.name, + ), + ); + + return Object.assign(deletedEvent, { + attachments: existingEvent.eventAttachmentsWhereEvent, + }); }); }, type: Event, diff --git a/src/graphql/types/Mutation/deleteFund.ts b/src/graphql/types/Mutation/deleteFund.ts index c0e8123fae8..95170f6286c 100644 --- a/src/graphql/types/Mutation/deleteFund.ts +++ b/src/graphql/types/Mutation/deleteFund.ts @@ -62,10 +62,14 @@ builder.mutationField("deleteFund", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteFundCampaign.ts b/src/graphql/types/Mutation/deleteFundCampaign.ts index 80f51157145..ec1443c0877 100644 --- a/src/graphql/types/Mutation/deleteFundCampaign.ts +++ b/src/graphql/types/Mutation/deleteFundCampaign.ts @@ -62,13 +62,19 @@ builder.mutationField("deleteFundCampaign", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteFundCampaignPledge.ts b/src/graphql/types/Mutation/deleteFundCampaignPledge.ts index 57b563a4050..bacfb7e8a22 100644 --- a/src/graphql/types/Mutation/deleteFundCampaignPledge.ts +++ b/src/graphql/types/Mutation/deleteFundCampaignPledge.ts @@ -67,13 +67,19 @@ builder.mutationField("deleteFundCampaignPledge", (t) => }, with: { campaign: { - columns: {}, + columns: { + startAt: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteOrganization.ts b/src/graphql/types/Mutation/deleteOrganization.ts index 6215fe9b51a..bcdf4d744ba 100644 --- a/src/graphql/types/Mutation/deleteOrganization.ts +++ b/src/graphql/types/Mutation/deleteOrganization.ts @@ -54,12 +54,60 @@ builder.mutationField("deleteOrganization", (t) => 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), - }); + const [currentUser, existingOrganization] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient.query.organizationsTable.findFirst({ + columns: { + avatarName: true, + }, + where: (fields, operators) => + operators.eq(fields.id, parsedArgs.input.id), + with: { + advertisementsWhereOrganization: { + columns: { + type: true, + }, + with: { + advertisementAttachmentsWhereAdvertisement: true, + }, + }, + chatsWhereOrganization: { + columns: { + avatarName: true, + }, + }, + eventsWhereOrganization: { + columns: { + startAt: true, + }, + with: { + eventAttachmentsWhereEvent: true, + }, + }, + postsWhereOrganization: { + columns: { + pinnedAt: true, + }, + with: { + postAttachmentsWherePost: true, + }, + }, + venuesWhereOrganization: { + columns: { + updatedAt: true, + }, + with: { + venueAttachmentsWhereVenue: true, + }, + }, + }, + }), + ]); if (currentUser === undefined) { throw new TalawaGraphQLError({ @@ -79,13 +127,7 @@ builder.mutationField("deleteOrganization", (t) => }); } - const [deletedOrganization] = await ctx.drizzleClient - .delete(organizationsTable) - .where(eq(organizationsTable.id, parsedArgs.input.id)) - .returning(); - - // Deleted organization not being returned means that either it doesn't exist or it was deleted or its `id` column was changed by external entities before this delete operation could take place. - if (deletedOrganization === undefined) { + if (existingOrganization === undefined) { throw new TalawaGraphQLError({ extensions: { code: "arguments_associated_resources_not_found", @@ -99,7 +141,68 @@ builder.mutationField("deleteOrganization", (t) => }); } - return deletedOrganization; + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedOrganization] = await tx + .delete(organizationsTable) + .where(eq(organizationsTable.id, parsedArgs.input.id)) + .returning(); + + // Deleted organization not being returned means that either it doesn't exist or it was deleted or its `id` column was changed by external entities before this delete operation could take place. + if (deletedOrganization === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "arguments_associated_resources_not_found", + issues: [ + { + argumentPath: ["input", "id"], + }, + ], + }, + message: + "No associated resources found for the provided arguments.", + }); + } + + const objectNames: string[] = []; + + if (existingOrganization.avatarName !== null) { + objectNames.push(existingOrganization.avatarName); + } + + for (const advertisement of existingOrganization.advertisementsWhereOrganization) { + for (const attachment of advertisement.advertisementAttachmentsWhereAdvertisement) { + objectNames.push(attachment.name); + } + } + + for (const chat of existingOrganization.chatsWhereOrganization) { + if (chat.avatarName !== null) { + objectNames.push(chat.avatarName); + } + } + + for (const event of existingOrganization.eventsWhereOrganization) { + for (const attachment of event.eventAttachmentsWhereEvent) { + objectNames.push(attachment.name); + } + } + + for (const post of existingOrganization.postsWhereOrganization) { + for (const attachment of post.postAttachmentsWherePost) { + objectNames.push(attachment.name); + } + } + + for (const venue of existingOrganization.venuesWhereOrganization) { + for (const attachment of venue.venueAttachmentsWhereVenue) { + objectNames.push(attachment.name); + } + } + + await ctx.minio.client.removeObjects(ctx.minio.bucketName, objectNames); + + return deletedOrganization; + }); }, type: Organization, }), diff --git a/src/graphql/types/Mutation/deleteOrganizationMembership.ts b/src/graphql/types/Mutation/deleteOrganizationMembership.ts index 897b10eaa3a..c23beb9679b 100644 --- a/src/graphql/types/Mutation/deleteOrganizationMembership.ts +++ b/src/graphql/types/Mutation/deleteOrganizationMembership.ts @@ -67,7 +67,9 @@ builder.mutationField("deleteOrganizationMembership", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.usersTable.findFirst({ - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.memberId), }), diff --git a/src/graphql/types/Mutation/deletePost.ts b/src/graphql/types/Mutation/deletePost.ts index 46f235fd6cd..862aa2dd05e 100644 --- a/src/graphql/types/Mutation/deletePost.ts +++ b/src/graphql/types/Mutation/deletePost.ts @@ -68,7 +68,9 @@ builder.mutationField("deletePost", (t) => with: { postAttachmentsWherePost: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -132,23 +134,32 @@ builder.mutationField("deletePost", (t) => } } - const [deletedPost] = await ctx.drizzleClient - .delete(postsTable) - .where(eq(postsTable.id, parsedArgs.input.id)) - .returning(); + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedPost] = await tx + .delete(postsTable) + .where(eq(postsTable.id, parsedArgs.input.id)) + .returning(); - // Deleted post not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation. - if (deletedPost === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); - } + // Deleted post not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation. + if (deletedPost === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + await ctx.minio.client.removeObjects( + ctx.minio.bucketName, + existingPost.postAttachmentsWherePost.map( + (attachment) => attachment.name, + ), + ); - return Object.assign(deletedPost, { - attachments: existingPost.postAttachmentsWherePost, + return Object.assign(deletedPost, { + attachments: existingPost.postAttachmentsWherePost, + }); }); }, type: Post, diff --git a/src/graphql/types/Mutation/deletePostVote.ts b/src/graphql/types/Mutation/deletePostVote.ts index 8af44a48762..131c1a2ce42 100644 --- a/src/graphql/types/Mutation/deletePostVote.ts +++ b/src/graphql/types/Mutation/deletePostVote.ts @@ -70,7 +70,9 @@ builder.mutationField("deletePostVote", (t) => ctx.drizzleClient.query.postsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -87,7 +89,9 @@ builder.mutationField("deletePostVote", (t) => operators.eq(fields.id, parsedArgs.input.postId), }), ctx.drizzleClient.query.postVotesTable.findFirst({ - columns: {}, + columns: { + type: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.creatorId, parsedArgs.input.creatorId), diff --git a/src/graphql/types/Mutation/deleteTag.ts b/src/graphql/types/Mutation/deleteTag.ts index 04c3a0c8416..b426fea3700 100644 --- a/src/graphql/types/Mutation/deleteTag.ts +++ b/src/graphql/types/Mutation/deleteTag.ts @@ -61,10 +61,14 @@ builder.mutationField("deleteTag", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.tagsTable.findFirst({ - columns: {}, + columns: { + updaterId: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteTagFolder.ts b/src/graphql/types/Mutation/deleteTagFolder.ts index 6ac9747edf7..00fbfb989c9 100644 --- a/src/graphql/types/Mutation/deleteTagFolder.ts +++ b/src/graphql/types/Mutation/deleteTagFolder.ts @@ -61,10 +61,14 @@ builder.mutationField("deleteTagFolder", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.tagFoldersTable.findFirst({ - columns: {}, + columns: { + updaterId: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/deleteUser.ts b/src/graphql/types/Mutation/deleteUser.ts index c09111b3550..f83739585dc 100755 --- a/src/graphql/types/Mutation/deleteUser.ts +++ b/src/graphql/types/Mutation/deleteUser.ts @@ -52,12 +52,21 @@ builder.mutationField("deleteUser", (t) => 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), - }); + const [currentUser, existingUser] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + avatarName: true, + }, + where: (fields, operators) => + operators.eq(fields.id, parsedArgs.input.id), + }), + ]); if (currentUser === undefined) { throw new TalawaGraphQLError({ @@ -77,44 +86,67 @@ builder.mutationField("deleteUser", (t) => }); } - if (parsedArgs.input.id === ctx.currentClient.user.id) { + if (existingUser === undefined) { throw new TalawaGraphQLError({ extensions: { - code: "forbidden_action_on_arguments_associated_resources", + code: "arguments_associated_resources_not_found", issues: [ { argumentPath: ["input", "id"], - message: - "You cannot delete the user associated to you with this action.", }, ], }, - message: - "This action is forbidden on the resources associated to the provided arguments.", + message: "No associated resources found for the provided arguments.", }); } - const [deletedUser] = await ctx.drizzleClient - .delete(usersTable) - .where(eq(usersTable.id, parsedArgs.input.id)) - .returning(); - - // Deleted user not being returned means that either it was deleted or its `id` column was changed by an external entity before this operation. - if (deletedUser === undefined) { + if (parsedArgs.input.id === ctx.currentClient.user.id) { throw new TalawaGraphQLError({ extensions: { - code: "arguments_associated_resources_not_found", + code: "forbidden_action_on_arguments_associated_resources", issues: [ { argumentPath: ["input", "id"], + message: + "You cannot delete the user associated to you with this action.", }, ], }, - message: "No associated resources found for the provided arguments.", + message: + "This action is forbidden on the resources associated to the provided arguments.", }); } - return deletedUser; + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedUser] = await tx + .delete(usersTable) + .where(eq(usersTable.id, parsedArgs.input.id)) + .returning(); + + // Deleted user not being returned means that either it was deleted or its `id` column was changed by an external entity before this operation. + if (deletedUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "arguments_associated_resources_not_found", + issues: [ + { + argumentPath: ["input", "id"], + }, + ], + }, + message: + "No associated resources found for the provided arguments.", + }); + } + + if (existingUser.avatarName !== null) + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + existingUser.avatarName, + ); + + return deletedUser; + }); }, type: User, }), diff --git a/src/graphql/types/Mutation/deleteVenue.ts b/src/graphql/types/Mutation/deleteVenue.ts index cc6411e5a69..3b35bc9bbd3 100644 --- a/src/graphql/types/Mutation/deleteVenue.ts +++ b/src/graphql/types/Mutation/deleteVenue.ts @@ -62,10 +62,14 @@ builder.mutationField("deleteVenue", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.venuesTable.findFirst({ - columns: {}, + columns: { + updaterId: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -128,23 +132,32 @@ builder.mutationField("deleteVenue", (t) => }); } - const [deletedVenue] = await ctx.drizzleClient - .delete(venuesTable) - .where(eq(venuesTable.id, parsedArgs.input.id)) - .returning(); + return await ctx.drizzleClient.transaction(async (tx) => { + const [deletedVenue] = await tx + .delete(venuesTable) + .where(eq(venuesTable.id, parsedArgs.input.id)) + .returning(); - // Deleted venue not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation could take place. - if (deletedVenue === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); - } + // Deleted venue not being returned means that either it was deleted or its `id` column was changed by external entities before this delete operation could take place. + if (deletedVenue === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } - return Object.assign(deletedVenue, { - attachments: existingVenue.venueAttachmentsWhereVenue, + await ctx.minio.client.removeObjects( + ctx.minio.bucketName, + existingVenue.venueAttachmentsWhereVenue.map( + (attachment) => attachment.name, + ), + ); + + return Object.assign(deletedVenue, { + attachments: existingVenue.venueAttachmentsWhereVenue, + }); }); }, type: Venue, diff --git a/src/graphql/types/Mutation/deleteVenueBooking.ts b/src/graphql/types/Mutation/deleteVenueBooking.ts index 5bfa41bbeb0..352f102c7fc 100644 --- a/src/graphql/types/Mutation/deleteVenueBooking.ts +++ b/src/graphql/types/Mutation/deleteVenueBooking.ts @@ -62,7 +62,9 @@ builder.mutationField("deleteVenueBooking", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.eventsTable.findFirst({ - columns: {}, + columns: { + startAt: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.eventId), }), @@ -71,7 +73,9 @@ builder.mutationField("deleteVenueBooking", (t) => operators.eq(fields.id, parsedArgs.input.venueId), with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -83,7 +87,9 @@ builder.mutationField("deleteVenueBooking", (t) => }, }, venueBookingsWhereVenue: { - columns: {}, + columns: { + creatorId: true, + }, where: (fields, operators) => operators.eq(fields.eventId, parsedArgs.input.eventId), }, diff --git a/src/graphql/types/Mutation/signUp.ts b/src/graphql/types/Mutation/signUp.ts index 7f3867ff783..67f5ca4d599 100755 --- a/src/graphql/types/Mutation/signUp.ts +++ b/src/graphql/types/Mutation/signUp.ts @@ -1,7 +1,10 @@ import { hash } from "@node-rs/argon2"; import { eq } from "drizzle-orm"; +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { uuidv7 } from "uuidv7"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { usersTable } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; import { @@ -9,10 +12,43 @@ import { mutationSignUpInputSchema, } from "~/src/graphql/inputs/MutationSignUpInput"; import { AuthenticationPayload } from "~/src/graphql/types/AuthenticationPayload"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationSignUpArgumentsSchema = z.object({ - input: mutationSignUpInputSchema, + input: mutationSignUpInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const { data, success } = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type "${rawAvatar.mimetype}" is not allowed.`, + }); + } else { + return { + ...arg, + avatar: Object.assign(rawAvatar, { + mimetype: data, + }), + }; + } + } + + return { + ...arg, + avatar, + }; + }), }); builder.mutationField("signUp", (t) => @@ -39,7 +75,7 @@ builder.mutationField("signUp", (t) => data: parsedArgs, error, success, - } = mutationSignUpArgumentsSchema.safeParse(args); + } = await mutationSignUpArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -76,40 +112,79 @@ builder.mutationField("signUp", (t) => } const userId = uuidv7(); + let avatarMimeType: z.infer; + let avatarName: string; - const [createdUser] = await ctx.drizzleClient - .insert(usersTable) - .values({ - ...parsedArgs.input, - creatorId: userId, - id: userId, - isEmailAddressVerified: false, - passwordHash: await hash(parsedArgs.input.password), - role: "regular", - }) - .returning(); - - // Inserted user not being returned is a external defect unrelated to this code. It is very unlikely for this error to occur. - if (createdUser === undefined) { - ctx.log.error( - "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", - ); - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = ulid(); + avatarMimeType = parsedArgs.input.avatar.mimetype; } - return { - authenticationToken: ctx.jwt.sign({ - user: { - id: createdUser.id, - }, - }), - user: createdUser, - }; + return await ctx.drizzleClient.transaction(async (tx) => { + const [createdUser] = await tx + .insert(usersTable) + .values({ + address: parsedArgs.input.address, + avatarMimeType, + avatarName, + birthDate: parsedArgs.input.birthDate, + city: parsedArgs.input.city, + countryCode: parsedArgs.input.countryCode, + creatorId: userId, + description: parsedArgs.input.description, + educationGrade: parsedArgs.input.educationGrade, + emailAddress: parsedArgs.input.emailAddress, + employmentStatus: parsedArgs.input.employmentStatus, + homePhoneNumber: parsedArgs.input.homePhoneNumber, + id: userId, + isEmailAddressVerified: false, + maritalStatus: parsedArgs.input.maritalStatus, + mobilePhoneNumber: parsedArgs.input.mobilePhoneNumber, + name: parsedArgs.input.name, + natalSex: parsedArgs.input.natalSex, + passwordHash: await hash(parsedArgs.input.password), + postalCode: parsedArgs.input.postalCode, + role: "regular", + state: parsedArgs.input.state, + workPhoneNumber: parsedArgs.input.workPhoneNumber, + }) + .returning(); + + // Inserted user not being returned is a external defect unrelated to this code. It is very unlikely for this error to occur. + if (createdUser === undefined) { + ctx.log.error( + "Postgres insert operation unexpectedly returned an empty array instead of throwing an error.", + ); + + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } + + return { + authenticationToken: ctx.jwt.sign({ + user: { + id: createdUser.id, + }, + }), + user: createdUser, + }; + }); }, type: AuthenticationPayload, }), diff --git a/src/graphql/types/Mutation/updateAdvertisement.ts b/src/graphql/types/Mutation/updateAdvertisement.ts index e0b9895821f..72d3d50a42c 100644 --- a/src/graphql/types/Mutation/updateAdvertisement.ts +++ b/src/graphql/types/Mutation/updateAdvertisement.ts @@ -70,7 +70,9 @@ builder.mutationField("updateAdvertisement", (t) => with: { advertisementAttachmentsWhereAdvertisement: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -153,7 +155,9 @@ builder.mutationField("updateAdvertisement", (t) => const existingAdvertisementWithName = await ctx.drizzleClient.query.advertisementsTable.findFirst({ - columns: {}, + columns: { + type: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.name, name), diff --git a/src/graphql/types/Mutation/updateAgendaFolder.ts b/src/graphql/types/Mutation/updateAgendaFolder.ts index b3d3af94545..5c6987fb37b 100644 --- a/src/graphql/types/Mutation/updateAgendaFolder.ts +++ b/src/graphql/types/Mutation/updateAgendaFolder.ts @@ -68,10 +68,14 @@ builder.mutationField("updateAgendaFolder", (t) => }, with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateAgendaItem.ts b/src/graphql/types/Mutation/updateAgendaItem.ts index 4c6e6c7a4b6..b963a106945 100644 --- a/src/graphql/types/Mutation/updateAgendaItem.ts +++ b/src/graphql/types/Mutation/updateAgendaItem.ts @@ -73,10 +73,14 @@ builder.mutationField("updateAgendaItem", (t) => }, with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateChat.ts b/src/graphql/types/Mutation/updateChat.ts index 4ea9b521de9..bc43385fdb1 100644 --- a/src/graphql/types/Mutation/updateChat.ts +++ b/src/graphql/types/Mutation/updateChat.ts @@ -1,5 +1,8 @@ import { eq } from "drizzle-orm"; +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { chatsTable } from "~/src/drizzle/tables/chats"; import { builder } from "~/src/graphql/builder"; import { @@ -7,10 +10,45 @@ import { mutationUpdateChatInputSchema, } from "~/src/graphql/inputs/MutationUpdateChatInput"; import { Chat } from "~/src/graphql/types/Chat/Chat"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateChatArgumentsSchema = z.object({ - input: mutationUpdateChatInputSchema, + input: mutationUpdateChatInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const result = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!result.success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type ${rawAvatar.mimetype} not allowed for this file upload.`, + }); + } else { + avatar = Object.assign(rawAvatar, { + mimetype: result.data, + }); + } + + return { + ...arg, + avatar, + }; + } + + return { + ...arg, + avatar: arg.avatar, + }; + }), }); builder.mutationField("updateChat", (t) => @@ -37,7 +75,7 @@ builder.mutationField("updateChat", (t) => data: parsedArgs, error, success, - } = mutationUpdateChatArgumentsSchema.safeParse(args); + } = await mutationUpdateChatArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -62,7 +100,9 @@ builder.mutationField("updateChat", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.chatsTable.findFirst({ - columns: {}, + columns: { + avatarName: true, + }, with: { chatMembershipsWhereChat: { columns: { @@ -72,7 +112,9 @@ builder.mutationField("updateChat", (t) => operators.eq(fields.memberId, currentUserId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -138,28 +180,64 @@ builder.mutationField("updateChat", (t) => }); } - const [updatedChat] = await ctx.drizzleClient - .update(chatsTable) - .set({ - avatarURI: parsedArgs.input.avatarURI, - description: parsedArgs.input.description, - name: parsedArgs.input.name, - updaterId: currentUserId, - }) - .where(eq(chatsTable.id, parsedArgs.input.id)) - .returning(); - - // Updated chat not being returned means that either it was deleted or its `id` column was changed by external entities before this update operation could take place. - if (updatedChat === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unexpected", - }, - message: "Something went wrong. Please try again.", - }); + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = + existingChat.avatarName === null ? ulid() : existingChat.avatarName; + avatarMimeType = parsedArgs.input.avatar.mimetype; } - return updatedChat; + return await ctx.drizzleClient.transaction(async (tx) => { + const [updatedChat] = await tx + .update(chatsTable) + .set({ + avatarMimeType: isNotNullish(parsedArgs.input.avatar) + ? avatarMimeType + : null, + avatarName: isNotNullish(parsedArgs.input.avatar) + ? avatarName + : null, + description: parsedArgs.input.description, + name: parsedArgs.input.name, + updaterId: currentUserId, + }) + .where(eq(chatsTable.id, parsedArgs.input.id)) + .returning(); + + // Updated chat not being returned means that either it was deleted or its `id` column was changed by external entities before this update operation could take place. + if (updatedChat === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unexpected", + }, + message: "Something went wrong. Please try again.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } else if ( + parsedArgs.input.avatar !== undefined && + existingChat.avatarName !== null + ) { + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + existingChat.avatarName, + ); + } + + return updatedChat; + }); }, type: Chat, }), diff --git a/src/graphql/types/Mutation/updateChatMembership.ts b/src/graphql/types/Mutation/updateChatMembership.ts index 8fc2abae238..18946e2bdf7 100644 --- a/src/graphql/types/Mutation/updateChatMembership.ts +++ b/src/graphql/types/Mutation/updateChatMembership.ts @@ -75,7 +75,9 @@ builder.mutationField("updateChatMembership", (t) => ]), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -91,7 +93,9 @@ builder.mutationField("updateChatMembership", (t) => operators.eq(fields.id, parsedArgs.input.chatId), }), ctx.drizzleClient.query.usersTable.findFirst({ - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.memberId), }), diff --git a/src/graphql/types/Mutation/updateChatMessage.ts b/src/graphql/types/Mutation/updateChatMessage.ts index d75be930765..b485966113c 100644 --- a/src/graphql/types/Mutation/updateChatMessage.ts +++ b/src/graphql/types/Mutation/updateChatMessage.ts @@ -67,15 +67,21 @@ builder.mutationField("updateChatMessage", (t) => }, with: { chat: { - columns: {}, + columns: { + avatarMimeType: true, + }, with: { chatMembershipsWhereChat: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateComment.ts b/src/graphql/types/Mutation/updateComment.ts index bc554d0c56e..96061d2e13e 100644 --- a/src/graphql/types/Mutation/updateComment.ts +++ b/src/graphql/types/Mutation/updateComment.ts @@ -67,10 +67,14 @@ builder.mutationField("updateComment", (t) => }, with: { post: { - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateCommentVote.ts b/src/graphql/types/Mutation/updateCommentVote.ts index 7454dfccf4c..5406b45869a 100644 --- a/src/graphql/types/Mutation/updateCommentVote.ts +++ b/src/graphql/types/Mutation/updateCommentVote.ts @@ -66,10 +66,14 @@ builder.mutationField("updateCommentVote", (t) => ctx.drizzleClient.query.commentsTable.findFirst({ with: { post: { - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -87,7 +91,9 @@ builder.mutationField("updateCommentVote", (t) => operators.eq(fields.id, parsedArgs.input.commentId), }), ctx.drizzleClient.query.commentVotesTable.findFirst({ - columns: {}, + columns: { + type: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.commentId, parsedArgs.input.commentId), diff --git a/src/graphql/types/Mutation/updateCurrentUser.ts b/src/graphql/types/Mutation/updateCurrentUser.ts index d33c5f35edc..26f37597bab 100755 --- a/src/graphql/types/Mutation/updateCurrentUser.ts +++ b/src/graphql/types/Mutation/updateCurrentUser.ts @@ -1,6 +1,9 @@ import { hash } from "@node-rs/argon2"; import { eq } from "drizzle-orm"; +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { usersTable } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; import { @@ -8,10 +11,43 @@ import { mutationUpdateCurrentUserInputSchema, } from "~/src/graphql/inputs/MutationUpdateCurrentUserInput"; import { User } from "~/src/graphql/types/User/User"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateCurrentUserArgumentsSchema = z.object({ - input: mutationUpdateCurrentUserInputSchema, + input: mutationUpdateCurrentUserInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const { data, success } = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type "${rawAvatar.mimetype}" is not allowed.`, + }); + } else { + return { + ...arg, + avatar: Object.assign(rawAvatar, { + mimetype: data, + }), + }; + } + } + + return { + ...arg, + avatar, + }; + }), }); builder.mutationField("updateCurrentUser", (t) => @@ -38,7 +74,7 @@ builder.mutationField("updateCurrentUser", (t) => success, data: parsedArgs, error, - } = mutationUpdateCurrentUserArgumentsSchema.safeParse(args); + } = await mutationUpdateCurrentUserArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -53,9 +89,27 @@ builder.mutationField("updateCurrentUser", (t) => }); } - const { emailAddress, password, ...input } = parsedArgs.input; + const currentUserId = ctx.currentClient.user.id; + + const currentUser = await ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + avatarName: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }); + + if (currentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + message: "Only authenticated users can perform this action.", + }); + } + + if (parsedArgs.input.emailAddress !== undefined) { + const emailAddress = parsedArgs.input.emailAddress; - if (emailAddress !== undefined) { const existingUserWithEmailAddress = await ctx.drizzleClient.query.usersTable.findFirst({ columns: { @@ -82,31 +136,82 @@ builder.mutationField("updateCurrentUser", (t) => } } - const passwordHash = - password !== undefined ? await hash(password) : undefined; - - const [updatedCurrentUser] = await ctx.drizzleClient - .update(usersTable) - .set({ - ...input, - emailAddress, - passwordHash, - updaterId: ctx.currentClient.user.id, - }) - .where(eq(usersTable.id, ctx.currentClient.user.id)) - .returning(); - - // Updated user not being returned means that either it was deleted or its `id` column was changed by an external entity before this update operation which correspondingly means that the current client is using an invalid authentication token which hasn't expired yet. - if (updatedCurrentUser === undefined) { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthenticated", - }, - message: "Only authenticated users can perform this action.", - }); + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = + currentUser.avatarName === null ? ulid() : currentUser.avatarName; + avatarMimeType = parsedArgs.input.avatar.mimetype; } - return updatedCurrentUser; + return await ctx.drizzleClient.transaction(async (tx) => { + const [updatedCurrentUser] = await tx + .update(usersTable) + .set({ + address: parsedArgs.input.address, + avatarMimeType: isNotNullish(parsedArgs.input.avatar) + ? avatarMimeType + : null, + avatarName: isNotNullish(parsedArgs.input.avatar) + ? avatarName + : null, + birthDate: parsedArgs.input.birthDate, + city: parsedArgs.input.city, + countryCode: parsedArgs.input.countryCode, + description: parsedArgs.input.description, + educationGrade: parsedArgs.input.educationGrade, + emailAddress: parsedArgs.input.emailAddress, + employmentStatus: parsedArgs.input.employmentStatus, + homePhoneNumber: parsedArgs.input.homePhoneNumber, + maritalStatus: parsedArgs.input.maritalStatus, + mobilePhoneNumber: parsedArgs.input.mobilePhoneNumber, + name: parsedArgs.input.name, + natalSex: parsedArgs.input.natalSex, + passwordHash: + parsedArgs.input.password !== undefined + ? await hash(parsedArgs.input.password) + : undefined, + postalCode: parsedArgs.input.postalCode, + state: parsedArgs.input.state, + updaterId: currentUserId, + workPhoneNumber: parsedArgs.input.workPhoneNumber, + }) + .where(eq(usersTable.id, currentUserId)) + .returning(); + + // Updated user not being returned means that either it was deleted or its `id` column was changed by an external entity before this update operation which correspondingly means that the current client is using an invalid authentication token which hasn't expired yet. + if (updatedCurrentUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthenticated", + }, + message: "Only authenticated users can perform this action.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } else if ( + parsedArgs.input.avatar !== undefined && + currentUser.avatarName !== null + ) { + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + currentUser.avatarName, + ); + } + + return updatedCurrentUser; + }); }, type: User, }), diff --git a/src/graphql/types/Mutation/updateEvent.ts b/src/graphql/types/Mutation/updateEvent.ts index 83c42a5f647..cf0eb5dff59 100644 --- a/src/graphql/types/Mutation/updateEvent.ts +++ b/src/graphql/types/Mutation/updateEvent.ts @@ -71,7 +71,9 @@ builder.mutationField("updateEvent", (t) => with: { eventAttachmentsWhereEvent: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateFund.ts b/src/graphql/types/Mutation/updateFund.ts index b44fec34f43..10bb833bad1 100644 --- a/src/graphql/types/Mutation/updateFund.ts +++ b/src/graphql/types/Mutation/updateFund.ts @@ -67,7 +67,9 @@ builder.mutationField("updateFund", (t) => }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -112,7 +114,9 @@ builder.mutationField("updateFund", (t) => const existingFundWithName = await ctx.drizzleClient.query.fundsTable.findFirst({ - columns: {}, + columns: { + isTaxDeductible: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.name, name), diff --git a/src/graphql/types/Mutation/updateFundCampaign.ts b/src/graphql/types/Mutation/updateFundCampaign.ts index d1581c4f6cd..1810791a443 100644 --- a/src/graphql/types/Mutation/updateFundCampaign.ts +++ b/src/graphql/types/Mutation/updateFundCampaign.ts @@ -69,10 +69,14 @@ builder.mutationField("updateFundCampaign", (t) => }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -157,7 +161,9 @@ builder.mutationField("updateFundCampaign", (t) => const existingFundCampaignWithName = await ctx.drizzleClient.query.fundCampaignsTable.findFirst({ - columns: {}, + columns: { + currencyCode: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.fundId, existingFundCampaign.fundId), diff --git a/src/graphql/types/Mutation/updateFundCampaignPledge.ts b/src/graphql/types/Mutation/updateFundCampaignPledge.ts index c80ac9918af..31bfeb27eec 100644 --- a/src/graphql/types/Mutation/updateFundCampaignPledge.ts +++ b/src/graphql/types/Mutation/updateFundCampaignPledge.ts @@ -67,13 +67,19 @@ builder.mutationField("updateFundCampaignPledge", (t) => }, with: { campaign: { - columns: {}, + columns: { + startAt: true, + }, with: { fund: { - columns: {}, + columns: { + isTaxDeductible: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateOrganization.ts b/src/graphql/types/Mutation/updateOrganization.ts index 1094e2ba435..b1a74165c7f 100644 --- a/src/graphql/types/Mutation/updateOrganization.ts +++ b/src/graphql/types/Mutation/updateOrganization.ts @@ -1,5 +1,8 @@ import { eq } from "drizzle-orm"; +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { organizationsTable } from "~/src/drizzle/tables/organizations"; import { builder } from "~/src/graphql/builder"; import { @@ -7,10 +10,45 @@ import { mutationUpdateOrganizationInputSchema, } from "~/src/graphql/inputs/MutationUpdateOrganizationInput"; import { Organization } from "~/src/graphql/types/Organization/Organization"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateOrganizationArgumentsSchema = z.object({ - input: mutationUpdateOrganizationInputSchema, + input: mutationUpdateOrganizationInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const result = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!result.success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type ${rawAvatar.mimetype} not allowed for this file upload.`, + }); + } else { + avatar = Object.assign(rawAvatar, { + mimetype: result.data, + }); + } + + return { + ...arg, + avatar, + }; + } + + return { + ...arg, + avatar: arg.avatar, + }; + }), }); builder.mutationField("updateOrganization", (t) => @@ -37,7 +75,7 @@ builder.mutationField("updateOrganization", (t) => success, data: parsedArgs, error, - } = mutationUpdateOrganizationArgumentsSchema.safeParse(args); + } = await mutationUpdateOrganizationArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -54,12 +92,21 @@ builder.mutationField("updateOrganization", (t) => 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), - }); + const [currentUser, existingOrganization] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient.query.organizationsTable.findFirst({ + columns: { + avatarName: true, + }, + where: (fields, operators) => + operators.eq(fields.id, parsedArgs.input.id), + }), + ]); if (currentUser === undefined) { throw new TalawaGraphQLError({ @@ -70,33 +117,7 @@ builder.mutationField("updateOrganization", (t) => }); } - if (currentUser.role !== "administrator") { - throw new TalawaGraphQLError({ - extensions: { - code: "unauthorized_action", - }, - message: "You are not authorized to perform this action.", - }); - } - - const [updatedOrganization] = await ctx.drizzleClient - .update(organizationsTable) - .set({ - address: parsedArgs.input.address, - avatarURI: parsedArgs.input.avatarURI, - city: parsedArgs.input.city, - countryCode: parsedArgs.input.countryCode, - description: parsedArgs.input.description, - name: parsedArgs.input.name, - postalCode: parsedArgs.input.postalCode, - state: parsedArgs.input.state, - updaterId: currentUserId, - }) - .where(eq(organizationsTable.id, parsedArgs.input.id)) - .returning(); - - // Updated organization not being returned means that either it doesn't exist or it was deleted or its `id` column was changed by external entities before this update operation could take place. - if (updatedOrganization === undefined) { + if (existingOrganization === undefined) { throw new TalawaGraphQLError({ extensions: { code: "arguments_associated_resources_not_found", @@ -110,7 +131,86 @@ builder.mutationField("updateOrganization", (t) => }); } - return updatedOrganization; + if (currentUser.role !== "administrator") { + throw new TalawaGraphQLError({ + extensions: { + code: "unauthorized_action", + }, + message: "You are not authorized to perform this action.", + }); + } + + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = + existingOrganization.avatarName === null + ? ulid() + : existingOrganization.avatarName; + avatarMimeType = parsedArgs.input.avatar.mimetype; + } + + return await ctx.drizzleClient.transaction(async (tx) => { + const [updatedOrganization] = await tx + .update(organizationsTable) + .set({ + address: parsedArgs.input.address, + avatarMimeType: isNotNullish(parsedArgs.input.avatar) + ? avatarMimeType + : null, + avatarName: isNotNullish(parsedArgs.input.avatar) + ? avatarName + : null, + city: parsedArgs.input.city, + countryCode: parsedArgs.input.countryCode, + description: parsedArgs.input.description, + name: parsedArgs.input.name, + postalCode: parsedArgs.input.postalCode, + state: parsedArgs.input.state, + updaterId: currentUserId, + }) + .where(eq(organizationsTable.id, parsedArgs.input.id)) + .returning(); + + // Updated organization not being returned means that either it doesn't exist or it was deleted or its `id` column was changed by external entities before this update operation could take place. + if (updatedOrganization === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "arguments_associated_resources_not_found", + issues: [ + { + argumentPath: ["input", "id"], + }, + ], + }, + message: + "No associated resources found for the provided arguments.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } else if ( + parsedArgs.input.avatar !== undefined && + existingOrganization.avatarName !== null + ) { + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + existingOrganization.avatarName, + ); + } + + return updatedOrganization; + }); }, type: Organization, }), diff --git a/src/graphql/types/Mutation/updateOrganizationMembership.ts b/src/graphql/types/Mutation/updateOrganizationMembership.ts index 742ae09a2a4..af4e3e9f768 100644 --- a/src/graphql/types/Mutation/updateOrganizationMembership.ts +++ b/src/graphql/types/Mutation/updateOrganizationMembership.ts @@ -67,7 +67,9 @@ builder.mutationField("updateOrganizationMembership", (t) => where: (fields, operators) => operators.eq(fields.id, currentUserId), }), ctx.drizzleClient.query.usersTable.findFirst({ - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.memberId), }), diff --git a/src/graphql/types/Mutation/updatePost.ts b/src/graphql/types/Mutation/updatePost.ts index 86048245e53..61a4dfc7c10 100644 --- a/src/graphql/types/Mutation/updatePost.ts +++ b/src/graphql/types/Mutation/updatePost.ts @@ -70,7 +70,9 @@ builder.mutationField("updatePost", (t) => with: { postAttachmentsWherePost: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updatePostVote.ts b/src/graphql/types/Mutation/updatePostVote.ts index b174e94cad9..e24222f4bfc 100644 --- a/src/graphql/types/Mutation/updatePostVote.ts +++ b/src/graphql/types/Mutation/updatePostVote.ts @@ -64,7 +64,9 @@ builder.mutationField("updatePostVote", (t) => ctx.drizzleClient.query.postsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -81,7 +83,9 @@ builder.mutationField("updatePostVote", (t) => operators.eq(fields.id, parsedArgs.input.postId), }), ctx.drizzleClient.query.postVotesTable.findFirst({ - columns: {}, + columns: { + type: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.creatorId, currentUserId), diff --git a/src/graphql/types/Mutation/updateTag.ts b/src/graphql/types/Mutation/updateTag.ts index 42b24950ef2..1725c96ec6a 100644 --- a/src/graphql/types/Mutation/updateTag.ts +++ b/src/graphql/types/Mutation/updateTag.ts @@ -68,7 +68,9 @@ builder.mutationField("updateTag", (t) => }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { @@ -157,7 +159,9 @@ builder.mutationField("updateTag", (t) => const existingTagWithName = await ctx.drizzleClient.query.tagsTable.findFirst({ - columns: {}, + columns: { + updaterId: true, + }, where: (fields, operators) => operators.and( operators.eq(fields.name, name), diff --git a/src/graphql/types/Mutation/updateTagFolder.ts b/src/graphql/types/Mutation/updateTagFolder.ts index 544a1406c00..c4fa7fbccc3 100644 --- a/src/graphql/types/Mutation/updateTagFolder.ts +++ b/src/graphql/types/Mutation/updateTagFolder.ts @@ -68,7 +68,9 @@ builder.mutationField("updateTagFolder", (t) => }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Mutation/updateUser.ts b/src/graphql/types/Mutation/updateUser.ts index 3fdd5637951..6eb38a3addf 100755 --- a/src/graphql/types/Mutation/updateUser.ts +++ b/src/graphql/types/Mutation/updateUser.ts @@ -1,6 +1,9 @@ import { hash } from "@node-rs/argon2"; import { eq } from "drizzle-orm"; +import type { FileUpload } from "graphql-upload-minimal"; +import { ulid } from "ulidx"; import { z } from "zod"; +import { imageMimeTypeEnum } from "~/src/drizzle/enums/imageMimeType"; import { usersTable } from "~/src/drizzle/tables/users"; import { builder } from "~/src/graphql/builder"; import { @@ -8,10 +11,43 @@ import { mutationUpdateUserInputSchema, } from "~/src/graphql/inputs/MutationUpdateUserInput"; import { User } from "~/src/graphql/types/User/User"; +import { isNotNullish } from "~/src/utilities/isNotNullish"; import { TalawaGraphQLError } from "~/src/utilities/talawaGraphQLError"; const mutationUpdateUserArgumentsSchema = z.object({ - input: mutationUpdateUserInputSchema, + input: mutationUpdateUserInputSchema.transform(async (arg, ctx) => { + let avatar: + | (FileUpload & { + mimetype: z.infer; + }) + | null + | undefined; + + if (isNotNullish(arg.avatar)) { + const rawAvatar = await arg.avatar; + const { data, success } = imageMimeTypeEnum.safeParse(rawAvatar.mimetype); + + if (!success) { + ctx.addIssue({ + code: "custom", + path: ["avatar"], + message: `Mime type "${rawAvatar.mimetype}" is not allowed.`, + }); + } else { + return { + ...arg, + avatar: Object.assign(rawAvatar, { + mimetype: data, + }), + }; + } + } + + return { + ...arg, + avatar, + }; + }), }); builder.mutationField("updateUser", (t) => @@ -38,7 +74,7 @@ builder.mutationField("updateUser", (t) => success, data: parsedArgs, error, - } = mutationUpdateUserArgumentsSchema.safeParse(args); + } = await mutationUpdateUserArgumentsSchema.safeParseAsync(args); if (!success) { throw new TalawaGraphQLError({ @@ -55,12 +91,19 @@ builder.mutationField("updateUser", (t) => 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), - }); + const [currentUser, existingUser] = await Promise.all([ + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => operators.eq(fields.id, currentUserId), + }), + ctx.drizzleClient.query.usersTable.findFirst({ + columns: { avatarName: true, role: true }, + where: (fields, operators) => + operators.eq(fields.id, parsedArgs.input.id), + }), + ]); if (currentUser === undefined) { throw new TalawaGraphQLError({ @@ -97,23 +140,7 @@ builder.mutationField("updateUser", (t) => }); } - const { id, ...input } = parsedArgs.input; - - const [updatedUser] = await ctx.drizzleClient - .update(usersTable) - .set({ - ...input, - passwordHash: - input.password !== undefined - ? await hash(input.password) - : undefined, - updaterId: currentUserId, - }) - .where(eq(usersTable.id, id)) - .returning(); - - // Updated user not being returned means that either the user does not exist or it was deleted or its `id` column was changed by an external entity before this upate operation. - if (updatedUser === undefined) { + if (existingUser === undefined) { throw new TalawaGraphQLError({ extensions: { code: "arguments_associated_resources_not_found", @@ -127,7 +154,90 @@ builder.mutationField("updateUser", (t) => }); } - return updatedUser; + let avatarMimeType: z.infer; + let avatarName: string; + + if (isNotNullish(parsedArgs.input.avatar)) { + avatarName = + existingUser.avatarName === null ? ulid() : existingUser.avatarName; + avatarMimeType = parsedArgs.input.avatar.mimetype; + } + + return await ctx.drizzleClient.transaction(async (tx) => { + const [updatedUser] = await ctx.drizzleClient + .update(usersTable) + .set({ + address: parsedArgs.input.address, + avatarMimeType: isNotNullish(parsedArgs.input.avatar) + ? avatarMimeType + : null, + avatarName: isNotNullish(parsedArgs.input.avatar) + ? avatarName + : null, + birthDate: parsedArgs.input.birthDate, + city: parsedArgs.input.city, + countryCode: parsedArgs.input.countryCode, + description: parsedArgs.input.description, + educationGrade: parsedArgs.input.educationGrade, + emailAddress: parsedArgs.input.emailAddress, + employmentStatus: parsedArgs.input.employmentStatus, + homePhoneNumber: parsedArgs.input.homePhoneNumber, + isEmailAddressVerified: parsedArgs.input.isEmailAddressVerified, + maritalStatus: parsedArgs.input.maritalStatus, + mobilePhoneNumber: parsedArgs.input.mobilePhoneNumber, + name: parsedArgs.input.name, + natalSex: parsedArgs.input.natalSex, + passwordHash: + parsedArgs.input.password !== undefined + ? await hash(parsedArgs.input.password) + : undefined, + postalCode: parsedArgs.input.postalCode, + state: parsedArgs.input.state, + role: parsedArgs.input.role, + updaterId: currentUserId, + workPhoneNumber: parsedArgs.input.workPhoneNumber, + }) + .where(eq(usersTable.id, parsedArgs.input.id)) + .returning(); + + // Updated user not being returned means that either the user does not exist or it was deleted or its `id` column was changed by an external entity before this upate operation. + if (updatedUser === undefined) { + throw new TalawaGraphQLError({ + extensions: { + code: "arguments_associated_resources_not_found", + issues: [ + { + argumentPath: ["input", "id"], + }, + ], + }, + message: + "No associated resources found for the provided arguments.", + }); + } + + if (isNotNullish(parsedArgs.input.avatar)) { + await ctx.minio.client.putObject( + ctx.minio.bucketName, + avatarName, + parsedArgs.input.avatar.createReadStream(), + undefined, + { + "content-type": parsedArgs.input.avatar.mimetype, + }, + ); + } else if ( + parsedArgs.input.avatar !== undefined && + existingUser.avatarName !== null + ) { + await ctx.minio.client.removeObject( + ctx.minio.bucketName, + existingUser.avatarName, + ); + } + + return updatedUser; + }); }, type: User, }), diff --git a/src/graphql/types/Mutation/updateVenue.ts b/src/graphql/types/Mutation/updateVenue.ts index 183c64a7794..29f2ea4b297 100644 --- a/src/graphql/types/Mutation/updateVenue.ts +++ b/src/graphql/types/Mutation/updateVenue.ts @@ -68,7 +68,9 @@ builder.mutationField("updateVenue", (t) => }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Organization/Organization.ts b/src/graphql/types/Organization/Organization.ts index 7ad0f2d106e..524bad9ce48 100644 --- a/src/graphql/types/Organization/Organization.ts +++ b/src/graphql/types/Organization/Organization.ts @@ -12,8 +12,8 @@ Organization.implement({ address: t.exposeString("address", { description: "Address of the organization.", }), - avatarURI: t.exposeString("avatarURI", { - description: "URI to the avatar of the organization.", + avatarMimeType: t.exposeString("avatarMimeType", { + description: "Mime type of the avatar of the organization.", }), city: t.exposeString("city", { description: "Name of the city where the organization exists in.", diff --git a/src/graphql/types/Organization/advertisements.ts b/src/graphql/types/Organization/advertisements.ts index 5a9327f0023..4febed544ad 100644 --- a/src/graphql/types/Organization/advertisements.ts +++ b/src/graphql/types/Organization/advertisements.ts @@ -87,7 +87,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/Organization/avatarURL.ts b/src/graphql/types/Organization/avatarURL.ts new file mode 100644 index 00000000000..f474c89b299 --- /dev/null +++ b/src/graphql/types/Organization/avatarURL.ts @@ -0,0 +1,15 @@ +import { Organization } from "./Organization"; + +Organization.implement({ + fields: (t) => ({ + avatarURL: t.field({ + description: "URL to the avatar of the organization.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.avatarName}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/graphql/types/Organization/events.ts b/src/graphql/types/Organization/events.ts index 3f9b7967eb5..7d36dfe2ae5 100644 --- a/src/graphql/types/Organization/events.ts +++ b/src/graphql/types/Organization/events.ts @@ -91,7 +91,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/Organization/index.ts b/src/graphql/types/Organization/index.ts index 6a9618327f9..4d57b95f4db 100644 --- a/src/graphql/types/Organization/index.ts +++ b/src/graphql/types/Organization/index.ts @@ -1,5 +1,6 @@ import "./Organization"; import "./advertisements"; +import "./avatarURL"; import "./chats"; import "./creator"; import "./events"; diff --git a/src/graphql/types/Organization/pinnedPosts.ts b/src/graphql/types/Organization/pinnedPosts.ts index 6490d3fe47b..78505743587 100644 --- a/src/graphql/types/Organization/pinnedPosts.ts +++ b/src/graphql/types/Organization/pinnedPosts.ts @@ -97,7 +97,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/Organization/posts.ts b/src/graphql/types/Organization/posts.ts index 23c5036f048..7739c9f18ef 100644 --- a/src/graphql/types/Organization/posts.ts +++ b/src/graphql/types/Organization/posts.ts @@ -84,7 +84,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/Organization/tagFolders.ts b/src/graphql/types/Organization/tagFolders.ts index fa4c737bec1..02847c81ef1 100644 --- a/src/graphql/types/Organization/tagFolders.ts +++ b/src/graphql/types/Organization/tagFolders.ts @@ -102,7 +102,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/Organization/tags.ts b/src/graphql/types/Organization/tags.ts index a9c7e1a573a..28fa4df3365 100644 --- a/src/graphql/types/Organization/tags.ts +++ b/src/graphql/types/Organization/tags.ts @@ -84,7 +84,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/Organization/venues.ts b/src/graphql/types/Organization/venues.ts index 21166eb7033..e7c36a3461a 100644 --- a/src/graphql/types/Organization/venues.ts +++ b/src/graphql/types/Organization/venues.ts @@ -87,7 +87,9 @@ Organization.implement({ }, with: { organizationMembershipsWhereMember: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.organizationId, parent.id), }, diff --git a/src/graphql/types/PostAttachment/PostAttachment.ts b/src/graphql/types/PostAttachment/PostAttachment.ts index 70b098f3dea..0d16c82b1ba 100644 --- a/src/graphql/types/PostAttachment/PostAttachment.ts +++ b/src/graphql/types/PostAttachment/PostAttachment.ts @@ -1,6 +1,5 @@ import type { postAttachmentsTable } from "~/src/drizzle/tables/postAttachments"; import { builder } from "~/src/graphql/builder"; -import { PostAttachmentType } from "~/src/graphql/enums/PostAttachmentType"; export type PostAttachment = typeof postAttachmentsTable.$inferSelect; @@ -10,12 +9,8 @@ export const PostAttachment = PostAttachment.implement({ description: "", fields: (t) => ({ - type: t.expose("type", { - description: "Type of the attachment.", - type: PostAttachmentType, - }), - uri: t.exposeString("uri", { - description: "URI to the attachment.", + mimeType: t.exposeString("mimeType", { + description: "Mime type of the attachment.", }), }), }); diff --git a/src/graphql/types/PostAttachment/index.ts b/src/graphql/types/PostAttachment/index.ts index e29c1c5bf51..944c25e8613 100644 --- a/src/graphql/types/PostAttachment/index.ts +++ b/src/graphql/types/PostAttachment/index.ts @@ -1 +1,2 @@ import "./PostAttachment"; +import "./url"; diff --git a/src/graphql/types/PostAttachment/url.ts b/src/graphql/types/PostAttachment/url.ts new file mode 100644 index 00000000000..fb95ebdbf72 --- /dev/null +++ b/src/graphql/types/PostAttachment/url.ts @@ -0,0 +1,15 @@ +import { PostAttachment } from "./PostAttachment"; + +PostAttachment.implement({ + fields: (t) => ({ + url: t.field({ + description: "URL to the attachment.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.name}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/graphql/types/Query/advertisement.ts b/src/graphql/types/Query/advertisement.ts index 1840d6aaeb7..5961fa91eab 100644 --- a/src/graphql/types/Query/advertisement.ts +++ b/src/graphql/types/Query/advertisement.ts @@ -63,10 +63,14 @@ builder.queryField("advertisement", (t) => with: { advertisementAttachmentsWhereAdvertisement: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/agendaFolder.ts b/src/graphql/types/Query/agendaFolder.ts index be40de7a490..0ec24493d3b 100644 --- a/src/graphql/types/Query/agendaFolder.ts +++ b/src/graphql/types/Query/agendaFolder.ts @@ -62,13 +62,19 @@ builder.queryField("agendaFolder", (t) => ctx.drizzleClient.query.agendaFoldersTable.findFirst({ with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/agendaItem.ts b/src/graphql/types/Query/agendaItem.ts index fadbd431aa4..a9b7e8a8e1e 100644 --- a/src/graphql/types/Query/agendaItem.ts +++ b/src/graphql/types/Query/agendaItem.ts @@ -62,16 +62,24 @@ builder.queryField("agendaItem", (t) => ctx.drizzleClient.query.agendaItemsTable.findFirst({ with: { folder: { - columns: {}, + columns: { + isAgendaItemFolder: true, + }, with: { event: { - columns: {}, + columns: { + startAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/chat.ts b/src/graphql/types/Query/chat.ts index 2cd305c7882..4492503e88b 100644 --- a/src/graphql/types/Query/chat.ts +++ b/src/graphql/types/Query/chat.ts @@ -62,10 +62,14 @@ builder.queryField("chat", (t) => ctx.drizzleClient.query.chatsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/chatMessage.ts b/src/graphql/types/Query/chatMessage.ts index 3876d198ff7..55186e60479 100644 --- a/src/graphql/types/Query/chatMessage.ts +++ b/src/graphql/types/Query/chatMessage.ts @@ -62,15 +62,21 @@ builder.queryField("chatMessage", (t) => ctx.drizzleClient.query.chatMessagesTable.findFirst({ with: { chat: { - columns: {}, + columns: { + avatarMimeType: true, + }, with: { chatMembershipsWhereChat: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Query/comment.ts b/src/graphql/types/Query/comment.ts index 04c99356244..785fd6494bf 100644 --- a/src/graphql/types/Query/comment.ts +++ b/src/graphql/types/Query/comment.ts @@ -62,13 +62,19 @@ builder.queryField("comment", (t) => ctx.drizzleClient.query.commentsTable.findFirst({ with: { post: { - columns: {}, + columns: { + pinnedAt: true, + }, with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/event.ts b/src/graphql/types/Query/event.ts index feadedeaa8c..a4d4dd5b16a 100644 --- a/src/graphql/types/Query/event.ts +++ b/src/graphql/types/Query/event.ts @@ -63,10 +63,14 @@ builder.queryField("event", (t) => with: { eventAttachmentsWhereEvent: true, organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/fund.ts b/src/graphql/types/Query/fund.ts index ad1523892ab..c298c08a3c9 100644 --- a/src/graphql/types/Query/fund.ts +++ b/src/graphql/types/Query/fund.ts @@ -71,10 +71,14 @@ builder.queryField("fund", (t) => const existingFund = await ctx.drizzleClient.query.fundsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/fundCampaign.ts b/src/graphql/types/Query/fundCampaign.ts index 9652abb26aa..30cdf0488f9 100644 --- a/src/graphql/types/Query/fundCampaign.ts +++ b/src/graphql/types/Query/fundCampaign.ts @@ -74,10 +74,14 @@ builder.queryField("fundCampaign", (t) => fund: { with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/fundCampaignPledge.ts b/src/graphql/types/Query/fundCampaignPledge.ts index c25bf10b857..32fc61593f2 100644 --- a/src/graphql/types/Query/fundCampaignPledge.ts +++ b/src/graphql/types/Query/fundCampaignPledge.ts @@ -72,12 +72,16 @@ builder.queryField("fundCampaignPledge", (t) => await ctx.drizzleClient.query.fundCampaignPledgesTable.findFirst({ with: { campaign: { - columns: {}, + columns: { + startAt: true, + }, with: { fund: { with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Query/post.ts b/src/graphql/types/Query/post.ts index c60fc7862b7..dbea344cfca 100644 --- a/src/graphql/types/Query/post.ts +++ b/src/graphql/types/Query/post.ts @@ -62,10 +62,14 @@ builder.queryField("post", (t) => ctx.drizzleClient.query.postsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/tag.ts b/src/graphql/types/Query/tag.ts index c7dc711614a..4da5769daa8 100644 --- a/src/graphql/types/Query/tag.ts +++ b/src/graphql/types/Query/tag.ts @@ -70,10 +70,14 @@ builder.queryField("tag", (t) => const existingTag = await ctx.drizzleClient.query.tagsTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Query/tagFolder.ts b/src/graphql/types/Query/tagFolder.ts index 8485b921be1..ab32409de07 100644 --- a/src/graphql/types/Query/tagFolder.ts +++ b/src/graphql/types/Query/tagFolder.ts @@ -71,7 +71,9 @@ builder.queryField("tagFolder", (t) => await ctx.drizzleClient.query.tagFoldersTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { columns: { diff --git a/src/graphql/types/Query/venue.ts b/src/graphql/types/Query/venue.ts index adf9b208cf0..438e03ce908 100644 --- a/src/graphql/types/Query/venue.ts +++ b/src/graphql/types/Query/venue.ts @@ -62,10 +62,14 @@ builder.queryField("venue", (t) => ctx.drizzleClient.query.venuesTable.findFirst({ with: { organization: { - columns: {}, + columns: { + countryCode: true, + }, with: { organizationMembershipsWhereOrganization: { - columns: {}, + columns: { + role: true, + }, where: (fields, operators) => operators.eq(fields.memberId, currentUserId), }, diff --git a/src/graphql/types/Subscription/chatMessageCreate.ts b/src/graphql/types/Subscription/chatMessageCreate.ts index 32ac28b3d7f..1935443f6b1 100644 --- a/src/graphql/types/Subscription/chatMessageCreate.ts +++ b/src/graphql/types/Subscription/chatMessageCreate.ts @@ -43,7 +43,9 @@ builder.subscriptionField("chatMessageCreate", (t) => } const existingChat = await ctx.drizzleClient.query.chatsTable.findFirst({ - columns: {}, + columns: { + avatarMimeType: true, + }, where: (fields, operators) => operators.eq(fields.id, parsedArgs.input.id), }); diff --git a/src/graphql/types/User/User.ts b/src/graphql/types/User/User.ts index b7408efbed0..01d6a669e4f 100644 --- a/src/graphql/types/User/User.ts +++ b/src/graphql/types/User/User.ts @@ -17,8 +17,8 @@ User.implement({ address: t.exposeString("address", { description: "Address of the user.", }), - avatarURI: t.exposeString("avatarURI", { - description: "URI to the avatar 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.", diff --git a/src/graphql/types/User/avatarURL.ts b/src/graphql/types/User/avatarURL.ts new file mode 100644 index 00000000000..fee763c1854 --- /dev/null +++ b/src/graphql/types/User/avatarURL.ts @@ -0,0 +1,15 @@ +import { User } from "./User"; + +User.implement({ + fields: (t) => ({ + avatarURL: t.field({ + description: "URL to the avatar of the user.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.avatarName}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/graphql/types/User/index.ts b/src/graphql/types/User/index.ts index 498793159c6..d99f78abb55 100644 --- a/src/graphql/types/User/index.ts +++ b/src/graphql/types/User/index.ts @@ -1,4 +1,5 @@ import "./User"; +import "./avatarURL"; import "./creator"; import "./organizationsWhereMember"; import "./updatedAt"; diff --git a/src/graphql/types/VenueAttachment/VenueAttachment.ts b/src/graphql/types/VenueAttachment/VenueAttachment.ts index 09fc103584a..7449acb364d 100644 --- a/src/graphql/types/VenueAttachment/VenueAttachment.ts +++ b/src/graphql/types/VenueAttachment/VenueAttachment.ts @@ -1,6 +1,5 @@ import type { venueAttachmentsTable } from "~/src/drizzle/tables/venueAttachments"; import { builder } from "~/src/graphql/builder"; -import { VenueAttachmentType } from "~/src/graphql/enums/VenueAttachmentType"; export type VenueAttachment = typeof venueAttachmentsTable.$inferSelect; @@ -10,12 +9,8 @@ export const VenueAttachment = VenueAttachment.implement({ description: "", fields: (t) => ({ - type: t.expose("type", { - description: "Type of the attachment.", - type: VenueAttachmentType, - }), - uri: t.exposeString("uri", { - description: "URI to the attachment.", + mimeType: t.exposeString("mimeType", { + description: "Mime type of the attachment.", }), }), }); diff --git a/src/graphql/types/VenueAttachment/index.ts b/src/graphql/types/VenueAttachment/index.ts index c31716840d3..047106dbbfa 100644 --- a/src/graphql/types/VenueAttachment/index.ts +++ b/src/graphql/types/VenueAttachment/index.ts @@ -1 +1,2 @@ import "./VenueAttachment"; +import "./url"; diff --git a/src/graphql/types/VenueAttachment/url.ts b/src/graphql/types/VenueAttachment/url.ts new file mode 100644 index 00000000000..3b97b97cfa0 --- /dev/null +++ b/src/graphql/types/VenueAttachment/url.ts @@ -0,0 +1,15 @@ +import { VenueAttachment } from "./VenueAttachment"; + +VenueAttachment.implement({ + fields: (t) => ({ + url: t.field({ + description: "URL to the attachment.", + resolve: async (parent, _args, ctx) => + new URL( + `/objects/${parent.name}`, + ctx.envConfig.API_BASE_URL, + ).toString(), + type: "String", + }), + }), +}); diff --git a/src/plugins/drizzleClient.ts b/src/plugins/drizzleClient.ts index ed9a2ff4ebe..84294dda580 100644 --- a/src/plugins/drizzleClient.ts +++ b/src/plugins/drizzleClient.ts @@ -14,9 +14,9 @@ declare module "fastify" { * * @example * - * import drizzleClient from "~/src/plugins/drizzleClient"; + * import drizzleClientPlugin from "~/src/plugins/drizzleClient"; * - * fastify.register(drizzleClient, {}); + * fastify.register(drizzleClientPlugin, {}); * const user = await fastify.drizzleClient.query.usersTable.findFirst(); */ export const drizzleClient = fastifyPlugin(async (fastify) => { diff --git a/src/plugins/index.ts b/src/plugins/index.ts index e889c3037e6..08a8ff02b52 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -1,10 +1,12 @@ import fastifyPlugin from "fastify-plugin"; import drizzleClient from "./drizzleClient"; +import minioClient from "./minioClient"; import seedDatabase from "./seedPostgres"; export const plugins = fastifyPlugin(async (fastify) => { fastify.register(drizzleClient); fastify.register(seedDatabase); + fastify.register(minioClient); }); export default plugins; diff --git a/src/plugins/minioClient.ts b/src/plugins/minioClient.ts new file mode 100644 index 00000000000..6e33f4ac780 --- /dev/null +++ b/src/plugins/minioClient.ts @@ -0,0 +1,74 @@ +import fastifyPlugin from "fastify-plugin"; +import { Client as MinioClient } from "minio"; + +declare module "fastify" { + interface FastifyInstance { + minio: { + bucketName: "talawa"; + client: MinioClient; + }; + } +} + +/** + * Integrates the talawa minio bucket name and a minio client instance on the namespaces `minio.bucketName` and `minio.client` respectively on the global fastify instance. + * + * @example + * import minioClientPlugin from "~src/plugins/minioClient"; + * + * fastify.register(minioClientPlugin, {}); + * const buckets = await fastify.minio.client.listBuckets(); + */ +export const minioClient = fastifyPlugin(async (fastify) => { + const client = new MinioClient({ + accessKey: fastify.envConfig.API_MINIO_ACCESS_KEY, + endPoint: fastify.envConfig.API_MINIO_END_POINT, + port: fastify.envConfig.API_MINIO_PORT, + secretKey: fastify.envConfig.API_MINIO_SECRET_KEY, + useSSL: fastify.envConfig.API_MINIO_USE_SSL, + }); + + let isBucketExists: boolean | undefined = undefined; + + try { + fastify.log.info("Checking the connection to the minio server."); + isBucketExists = await client.bucketExists("talawa"); + fastify.log.info("Successfully connected to the minio server."); + } catch (error) { + throw new Error("Failed to connect to the minio server.", { + cause: error, + }); + } + + fastify.log.info( + `Checking if the "talawa" bucket exists in the minio server.`, + ); + + if (isBucketExists) { + fastify.log.info( + `"talawa" bucket already exists in the minio server. Skipping, the bucket creation.`, + ); + } else { + try { + fastify.log.info(`Creating the "talawa" bucket in the minio server.`); + await client.makeBucket("talawa"); + fastify.log.info( + `Successfully created the "talawa" bucket in the minio server.`, + ); + } catch (error) { + throw new Error( + `Failed to create the "talawa" bucket in the minio server.`, + { + cause: error, + }, + ); + } + } + + fastify.decorate("minio", { + bucketName: "talawa", + client, + }); +}, {}); + +export default minioClient; diff --git a/src/plugins/seedPostgres.ts b/src/plugins/seedPostgres.ts index d4f4b810284..a105716b82d 100644 --- a/src/plugins/seedPostgres.ts +++ b/src/plugins/seedPostgres.ts @@ -5,7 +5,7 @@ import { uuidv7 } from "uuidv7"; import type { z } from "zod"; import { usersTable, usersTableInsertSchema } from "~/src/drizzle/tables/users"; -// TODO:- Will be replaced with a different implementation in the future. +// TODO: Will be replaced with a different implementation in the future. /** * This plugin handles seeding the database with data at the startup time of the talawa api. @@ -16,21 +16,35 @@ import { usersTable, usersTableInsertSchema } from "~/src/drizzle/tables/users"; * fastify.register(seedDatabasePlugin, {}); */ const plugin: FastifyPluginAsync = async (fastify) => { - const existingAdministrator = - await fastify.drizzleClient.query.usersTable.findFirst({ - columns: { - role: true, - }, - where: (fields, operators) => - operators.eq( - fields.emailAddress, - fastify.envConfig.API_ADMINISTRATOR_USER_EMAIL_ADDRESS, - ), - }); - fastify.log.info( "Checking if the administrator already exists in the database.", ); + + let existingAdministrator: + | Pick + | undefined; + + try { + existingAdministrator = + await fastify.drizzleClient.query.usersTable.findFirst({ + columns: { + role: true, + }, + where: (fields, operators) => + operators.eq( + fields.emailAddress, + fastify.envConfig.API_ADMINISTRATOR_USER_EMAIL_ADDRESS, + ), + }); + } catch (error) { + throw new Error( + "Failed to check if the administrator already exists in the database.", + { + cause: error, + }, + ); + } + if (existingAdministrator !== undefined) { fastify.log.info( "Administrator already exists in the database. Skipping, the administrator creation.", @@ -39,6 +53,7 @@ const plugin: FastifyPluginAsync = async (fastify) => { fastify.log.info( "Administrator does not exist in the database. Creating the administrator.", ); + const userId = uuidv7(); const input: z.infer = { creatorId: userId, @@ -52,9 +67,15 @@ const plugin: FastifyPluginAsync = async (fastify) => { role: "administrator", }; - await fastify.drizzleClient - .insert(usersTable) - .values(usersTableInsertSchema.parse(input)); + try { + await fastify.drizzleClient + .insert(usersTable) + .values(usersTableInsertSchema.parse(input)); + } catch (error) { + throw new Error("Failed to create the administrator in the database.", { + cause: error, + }); + } fastify.log.info("Successfully created the administrator in the database."); } diff --git a/src/routes/graphql.ts b/src/routes/graphql.ts index 514fe8ab1c3..cb63a51ac9e 100644 --- a/src/routes/graphql.ts +++ b/src/routes/graphql.ts @@ -1,6 +1,7 @@ import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; import fastifyPlugin from "fastify-plugin"; import { mercurius } from "mercurius"; +import { mercuriusUpload } from "mercurius-upload"; import type { CurrentClient, ExplicitAuthenticationTokenPayload, @@ -66,11 +67,13 @@ export const createContext: CreateContext = async (initialContext) => { return { currentClient, drizzleClient: fastify.drizzleClient, + envConfig: fastify.envConfig, jwt: { sign: (payload: ExplicitAuthenticationTokenPayload) => fastify.jwt.sign(payload), }, log: fastify.log, + minio: fastify.minio, }; }; @@ -78,6 +81,29 @@ export const createContext: CreateContext = async (initialContext) => { * This fastify route plugin function is initializes mercurius on the fastify instance and directs incoming requests on the `/graphql` route to it. */ export const graphql = fastifyPlugin(async (fastify) => { + /** + * More information at these links: + * 1. {@link https://github.com/mercurius-js/mercurius-upload} + * 2. {@link https://github.com/flash-oss/graphql-upload-minimal/blob/56e83775b114edc169f605041d983156d4131387/public/index.js#L61} + */ + fastify.register(mercuriusUpload, { + /** + * Maximum allowed non-file multipart form field size in bytes. This basically means the size of the actual graphql document excluding the size of the file uploads carried along with it. + * + * 1024 * 1024 + */ + maxFieldSize: 1048576, + /** + * Maximum allowed number of files in a single graphql operation. + */ + maxFiles: 20, + /** + * Maximum allowed file size in bytes. + * 1024 * 1024 * 10 + */ + maxFileSize: 10485760, + }); + // More information at this link: https://mercurius.dev/#/docs/api/options?id=mercurius fastify.register(mercurius, { context: (request, reply) => diff --git a/src/routes/index.ts b/src/routes/index.ts index e8340e83511..932063dbe56 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -1,6 +1,7 @@ import fastifyPlugin from "fastify-plugin"; import graphql from "./graphql"; import healthcheck from "./healthcheck"; +import objects from "./objects"; /** * This fastify plugin function contains all talawa api routes within it. @@ -12,6 +13,7 @@ import healthcheck from "./healthcheck"; export const routes = fastifyPlugin(async (fastify) => { fastify.register(graphql); fastify.register(healthcheck); + fastify.register(objects); }); export default routes; diff --git a/src/routes/objects.ts b/src/routes/objects.ts new file mode 100644 index 00000000000..97e62d52dc7 --- /dev/null +++ b/src/routes/objects.ts @@ -0,0 +1,66 @@ +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"; + +/** + * 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. + */ +export const objects: FastifyPluginAsyncTypebox = async (fastify) => { + fastify.get( + "/objects/:name", + { + schema: { + params: Type.Object({ + name: Type.String({ + maxLength: 36, + minLength: 1, + }), + }), + }, + }, + async (request, reply) => { + const { name } = request.params; + + let readableStream: Readable; + let objectStat: BucketItemStat; + + try { + [readableStream, objectStat] = await Promise.all([ + fastify.minio.client.getObject(fastify.minio.bucketName, name), + fastify.minio.client.statObject(fastify.minio.bucketName, name), + ]); + } catch (error) { + fastify.log.error( + error, + `Error encountered while fetching the object with the name "${name}" from the minio server.`, + ); + + if (error instanceof InvalidObjectNameError) { + return reply.status(404).send({ + message: `No object found with the name "${name}".`, + }); + } + + return reply.status(500).send({ + message: "Something went wrong. Please try again later.", + }); + } + + reply.headers({ + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition + "content-disposition": `inline; filename=${name}`, + // https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types + "content-type": + "content-type" in objectStat.metaData && + typeof objectStat.metaData["content-type"] === "string" + ? objectStat.metaData["content-type"] + : "application/octet-stream", + }); + + return reply.send(readableStream); + }, + ); +}; + +export default objects; diff --git a/test/routes/graphql/Mutation/createUser.test.ts b/test/routes/graphql/Mutation/createUser.test.ts index e943100cae1..8bd8875e522 100644 --- a/test/routes/graphql/Mutation/createUser.test.ts +++ b/test/routes/graphql/Mutation/createUser.test.ts @@ -27,7 +27,7 @@ suite("Mutation field createUser", () => { { variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -77,7 +77,7 @@ suite("Mutation field createUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -107,7 +107,7 @@ suite("Mutation field createUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -137,7 +137,6 @@ suite("Mutation field createUser", () => { `results in a graphql error with "invalid_arguments" extensions code in the "errors" field and "null" as the value of "data.createUser" field if`, () => { test(`length of the value of the argument "input.address" is less than 1. - length of the value of the argument "input.avatarURI" is less than 1. length of the value of the argument "input.city" is less than 1. length of the value of the argument "input.description" is less than 1. length of the value of the argument "input.name" is less than 1. @@ -170,10 +169,9 @@ suite("Mutation field createUser", () => { variables: { input: { address: "", - avatarURI: "", city: "", description: "", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "", password: "", @@ -198,10 +196,6 @@ suite("Mutation field createUser", () => { argumentPath: ["input", "address"], message: expect.any(String), }, - { - argumentPath: ["input", "avatarURI"], - message: expect.any(String), - }, { argumentPath: ["input", "city"], message: expect.any(String), @@ -270,7 +264,7 @@ suite("Mutation field createUser", () => { address: `address${faker.string.alpha(1025)}`, city: `city${faker.string.alpha(65)}`, description: `description${faker.string.alpha(2049)}`, - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: `name${faker.string.alpha(257)}`, password: `password${faker.string.alpha(65)}`, @@ -359,7 +353,7 @@ suite("Mutation field createUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -381,7 +375,7 @@ suite("Mutation field createUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -502,13 +496,12 @@ suite("Mutation field createUser", () => { const variables: VariablesOf = { input: { address: "address", - avatarURI: "avatarURI", birthDate: "1901-01-01", city: "city", countryCode: "us", description: "description", educationGrade: "kg", - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, employmentStatus: "part_time", homePhoneNumber: "+11111111", isEmailAddressVerified: false, @@ -548,7 +541,6 @@ suite("Mutation field createUser", () => { > >({ address: variables.input.address, - avatarURI: variables.input.avatarURI, birthDate: variables.input.birthDate, city: variables.input.city, countryCode: variables.input.countryCode, @@ -594,13 +586,12 @@ suite("Mutation field createUser", () => { const variables: VariablesOf = { input: { address: null, - avatarURI: null, birthDate: null, city: null, countryCode: null, description: null, educationGrade: null, - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, employmentStatus: null, homePhoneNumber: null, isEmailAddressVerified: false, @@ -640,7 +631,6 @@ suite("Mutation field createUser", () => { > >({ address: variables.input.address, - avatarURI: variables.input.avatarURI, birthDate: variables.input.birthDate, city: variables.input.city, countryCode: variables.input.countryCode, @@ -679,7 +669,7 @@ suite("Mutation field createUser", () => { const variables: VariablesOf = { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -711,7 +701,6 @@ suite("Mutation field createUser", () => { > >({ address: null, - avatarURI: null, birthDate: null, city: null, countryCode: null, diff --git a/test/routes/graphql/Mutation/deleteCurrentUser.test.ts b/test/routes/graphql/Mutation/deleteCurrentUser.test.ts index bdfa5236930..7abbd2e94f3 100644 --- a/test/routes/graphql/Mutation/deleteCurrentUser.test.ts +++ b/test/routes/graphql/Mutation/deleteCurrentUser.test.ts @@ -63,7 +63,7 @@ suite("Mutation field deleteCurrentUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -138,7 +138,7 @@ suite("Mutation field deleteCurrentUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/Mutation/deleteUser.test.ts b/test/routes/graphql/Mutation/deleteUser.test.ts index c2f4096a748..998057faae6 100644 --- a/test/routes/graphql/Mutation/deleteUser.test.ts +++ b/test/routes/graphql/Mutation/deleteUser.test.ts @@ -47,7 +47,7 @@ suite("Mutation field deleteUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -110,7 +110,7 @@ suite("Mutation field deleteUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -255,7 +255,7 @@ suite("Mutation field deleteUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -331,7 +331,7 @@ suite("Mutation field deleteUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -417,7 +417,7 @@ suite("Mutation field deleteUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -503,7 +503,7 @@ suite("Mutation field deleteUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/Mutation/signUp.test.ts b/test/routes/graphql/Mutation/signUp.test.ts index aa56752914c..5b5abc28b6b 100644 --- a/test/routes/graphql/Mutation/signUp.test.ts +++ b/test/routes/graphql/Mutation/signUp.test.ts @@ -41,7 +41,7 @@ suite("Mutation field signUp", () => { variables: { input: { confirmedPassword: "password", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, name: "name", password: "password", }, @@ -68,7 +68,6 @@ suite("Mutation field signUp", () => { `results in a graphql error with "invalid_arguments" extensions code in the "errors" field and "null" as the value of "data.signUp" field if`, () => { test(`length of the value of the argument "input.address" is less than 1. - length of the value of the argument "input.avatarURI" is less than 1. length of the value of the argument "input.city" is less than 1. length of the value of the argument "input.confirmedPassword" is less than 1. length of the value of the argument "input.description" is less than 1. @@ -80,11 +79,10 @@ suite("Mutation field signUp", () => { variables: { input: { address: "", - avatarURI: "", city: "", confirmedPassword: "", description: "", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, name: "", password: "", postalCode: "", @@ -106,10 +104,6 @@ suite("Mutation field signUp", () => { argumentPath: ["input", "address"], message: expect.any(String), }, - { - argumentPath: ["input", "avatarURI"], - message: expect.any(String), - }, { argumentPath: ["input", "city"], message: expect.any(String), @@ -162,7 +156,7 @@ suite("Mutation field signUp", () => { city: `city${faker.string.alpha(65)}`, confirmedPassword: `confirmedPassword${faker.string.alpha(65)}`, description: `description${faker.string.alpha(2049)}`, - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, name: `name${faker.string.alpha(257)}`, password: `password${faker.string.alpha(65)}`, postalCode: `postalCode${faker.string.alpha(33)}`, @@ -227,7 +221,7 @@ suite("Mutation field signUp", () => { variables: { input: { confirmedPassword: "confirmedPassword", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, name: "name", password: "password", }, @@ -314,14 +308,13 @@ suite("Mutation field signUp", () => { const variables: VariablesOf = { input: { address: "address", - avatarURI: "avatarURI", birthDate: "1901-01-01", city: "city", confirmedPassword: "password", countryCode: "us", description: "description", educationGrade: "kg", - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, employmentStatus: "part_time", homePhoneNumber: "+11111111", maritalStatus: "widowed", @@ -349,7 +342,6 @@ suite("Mutation field signUp", () => { > >({ address: variables.input.address, - avatarURI: variables.input.avatarURI, birthDate: variables.input.birthDate, city: variables.input.city, countryCode: variables.input.countryCode, @@ -378,7 +370,7 @@ suite("Mutation field signUp", () => { const variables: VariablesOf = { input: { confirmedPassword: "password", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, name: "name", password: "password", }, @@ -398,7 +390,6 @@ suite("Mutation field signUp", () => { > >({ address: null, - avatarURI: null, birthDate: null, city: null, countryCode: null, diff --git a/test/routes/graphql/Mutation/updateCurrentUser.test.ts b/test/routes/graphql/Mutation/updateCurrentUser.test.ts index 3296fb51b5a..11b789dd377 100644 --- a/test/routes/graphql/Mutation/updateCurrentUser.test.ts +++ b/test/routes/graphql/Mutation/updateCurrentUser.test.ts @@ -71,7 +71,7 @@ suite("Mutation field updateCurrentUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -157,7 +157,7 @@ suite("Mutation field updateCurrentUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -208,7 +208,6 @@ suite("Mutation field updateCurrentUser", () => { }); test(`length of the value of the argument "input.address" is less than 1. - length of the value of the argument "input.avatarURI" is less than 1. length of the value of the argument "input.city" is less than 1. length of the value of the argument "input.description" is less than 1. length of the value of the argument "input.name" is less than 1. @@ -240,7 +239,7 @@ suite("Mutation field updateCurrentUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -263,7 +262,6 @@ suite("Mutation field updateCurrentUser", () => { variables: { input: { address: "", - avatarURI: "", city: "", description: "", name: "", @@ -288,10 +286,6 @@ suite("Mutation field updateCurrentUser", () => { argumentPath: ["input", "address"], message: expect.any(String), }, - { - argumentPath: ["input", "avatarURI"], - message: expect.any(String), - }, { argumentPath: ["input", "city"], message: expect.any(String), @@ -357,7 +351,7 @@ suite("Mutation field updateCurrentUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -465,7 +459,7 @@ suite("Mutation field updateCurrentUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -556,7 +550,7 @@ suite("Mutation field updateCurrentUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -637,13 +631,12 @@ suite("Mutation field updateCurrentUser", () => { const createUserVariables: VariablesOf = { input: { address: "address", - avatarURI: "avatarURI", birthDate: "1901-01-01", city: "city", countryCode: "us", description: "description", educationGrade: "pre_kg", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, employmentStatus: "full_time", homePhoneNumber: "+11111111", isEmailAddressVerified: false, @@ -678,13 +671,12 @@ suite("Mutation field updateCurrentUser", () => { > = { input: { address: null, - avatarURI: null, birthDate: null, city: null, countryCode: null, description: null, educationGrade: null, - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, employmentStatus: null, homePhoneNumber: null, maritalStatus: null, @@ -716,7 +708,6 @@ suite("Mutation field updateCurrentUser", () => { > >({ address: updateCurrentUserVariables.input.address, - avatarURI: updateCurrentUserVariables.input.avatarURI, birthDate: updateCurrentUserVariables.input.birthDate, city: updateCurrentUserVariables.input.city, countryCode: updateCurrentUserVariables.input.countryCode, diff --git a/test/routes/graphql/Mutation/updateUser.test.ts b/test/routes/graphql/Mutation/updateUser.test.ts index 69de065f811..2e15d614cd9 100644 --- a/test/routes/graphql/Mutation/updateUser.test.ts +++ b/test/routes/graphql/Mutation/updateUser.test.ts @@ -2,6 +2,7 @@ import { faker } from "@faker-js/faker"; import type { ResultOf, VariablesOf } from "gql.tada"; import { expect, suite, test } from "vitest"; import type { + ArgumentsAssociatedResourcesNotFoundExtensions, ForbiddenActionOnArgumentsAssociatedResourcesExtensions, InvalidArgumentsExtensions, TalawaGraphQLFormattedError, @@ -48,7 +49,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -111,7 +112,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -198,7 +199,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -249,7 +250,6 @@ suite("Mutation field updateUser", () => { }); test(`length of the value of the argument "input.address" is less than 1. - length of the value of the argument "input.avatarURI" is less than 1. length of the value of the argument "input.city" is less than 1. length of the value of the argument "input.description" is less than 1. length of the value of the argument "input.name" is less than 1. @@ -281,7 +281,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -302,7 +302,6 @@ suite("Mutation field updateUser", () => { variables: { input: { address: "", - avatarURI: "", city: "", description: "", id: createUserResult.data.createUser.user.id, @@ -328,10 +327,6 @@ suite("Mutation field updateUser", () => { argumentPath: ["input", "address"], message: expect.any(String), }, - { - argumentPath: ["input", "avatarURI"], - message: expect.any(String), - }, { argumentPath: ["input", "city"], message: expect.any(String), @@ -397,7 +392,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -506,7 +501,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -606,7 +601,7 @@ suite("Mutation field updateUser", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -721,6 +716,99 @@ suite("Mutation field updateUser", () => { }, ); + suite( + `results in a graphql error with "arguments_associated_resources_not_found" extensions code in the "errors" field and "null" as the value of "data.deleteUser" field if`, + () => { + test(`value of the argument "input.id" doesn't correspond to an existing user.`, async () => { + const administratorUserSignInResult = await mercuriusClient.query( + Query_signIn, + { + variables: { + input: { + emailAddress: + server.envConfig.API_ADMINISTRATOR_USER_EMAIL_ADDRESS, + password: server.envConfig.API_ADMINISTRATOR_USER_PASSWORD, + }, + }, + }, + ); + + assertToBeNonNullish( + administratorUserSignInResult.data.signIn?.authenticationToken, + ); + + const createUserResult = await mercuriusClient.mutate( + Mutation_createUser, + { + headers: { + authorization: `bearer ${administratorUserSignInResult.data.signIn.authenticationToken}`, + }, + variables: { + input: { + emailAddress: `email${faker.string.ulid()}@email.com`, + isEmailAddressVerified: false, + name: "name", + password: "password", + role: "regular", + }, + }, + }, + ); + + assertToBeNonNullish(createUserResult.data.createUser?.user?.id); + + await mercuriusClient.mutate(Mutation_deleteUser, { + headers: { + authorization: `bearer ${administratorUserSignInResult.data.signIn.authenticationToken}`, + }, + variables: { + input: { + id: createUserResult.data.createUser.user.id, + }, + }, + }); + + const updateUserResult = await mercuriusClient.mutate( + Mutation_updateUser, + { + headers: { + authorization: `bearer ${administratorUserSignInResult.data.signIn.authenticationToken}`, + }, + variables: { + input: { + id: createUserResult.data.createUser.user.id, + name: "name", + }, + }, + }, + ); + + expect(updateUserResult.data.updateUser).toEqual(null); + expect(updateUserResult.errors).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + extensions: + expect.objectContaining( + { + code: "arguments_associated_resources_not_found", + issues: expect.arrayContaining< + ArgumentsAssociatedResourcesNotFoundExtensions["issues"][number] + >([ + { + argumentPath: ["input", "id"], + }, + ]), + }, + ), + message: expect.any(String), + path: ["updateUser"], + }), + ]), + ); + }); + }, + ); + suite( `results in "undefined" as the value of "errors" field and the expected value for the "data.updateUser" field where`, () => { @@ -746,13 +834,12 @@ suite("Mutation field updateUser", () => { const createUserVariables: VariablesOf = { input: { address: "address", - avatarURI: "avatarURI", birthDate: "1901-01-01", city: "city", countryCode: "us", description: "description", educationGrade: "pre_kg", - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, employmentStatus: "full_time", homePhoneNumber: "+11111111", isEmailAddressVerified: false, @@ -786,13 +873,12 @@ suite("Mutation field updateUser", () => { const updateUserVariables: VariablesOf = { input: { address: null, - avatarURI: null, birthDate: null, city: null, countryCode: null, description: null, educationGrade: null, - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, employmentStatus: null, homePhoneNumber: null, id: createUserResult.data.createUser.user.id, @@ -825,7 +911,6 @@ suite("Mutation field updateUser", () => { Partial["updateUser"]> >({ address: updateUserVariables.input.address, - avatarURI: updateUserVariables.input.avatarURI, birthDate: updateUserVariables.input.birthDate, city: updateUserVariables.input.city, countryCode: updateUserVariables.input.countryCode, diff --git a/test/routes/graphql/Query/currentUser.test.ts b/test/routes/graphql/Query/currentUser.test.ts index 7a49182e664..1f5f95c5f84 100644 --- a/test/routes/graphql/Query/currentUser.test.ts +++ b/test/routes/graphql/Query/currentUser.test.ts @@ -62,7 +62,7 @@ suite("Query field currentUser", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/Query/renewAuthenticationToken.test.ts b/test/routes/graphql/Query/renewAuthenticationToken.test.ts index c8bc35c28e4..b37075b4d78 100644 --- a/test/routes/graphql/Query/renewAuthenticationToken.test.ts +++ b/test/routes/graphql/Query/renewAuthenticationToken.test.ts @@ -66,7 +66,7 @@ suite("Query field renewAuthenticationToken", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/Query/signIn.test.ts b/test/routes/graphql/Query/signIn.test.ts index 8a3105e61d6..90ba60684ae 100644 --- a/test/routes/graphql/Query/signIn.test.ts +++ b/test/routes/graphql/Query/signIn.test.ts @@ -35,7 +35,7 @@ suite("Query field signIn", () => { }, variables: { input: { - emailAddress: `emailAddress${faker.string.nanoid()}@email.com`, + emailAddress: `emailAddress${faker.string.ulid()}@email.com`, password: "password", }, }, @@ -64,8 +64,8 @@ suite("Query field signIn", () => { const result = await mercuriusClient.query(Query_signIn, { variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, - password: `password${faker.string.nanoid()}`, + emailAddress: `email${faker.string.ulid()}@email.com`, + password: `password${faker.string.ulid()}`, }, }, }); @@ -105,7 +105,7 @@ suite("Query field signIn", () => { input: { emailAddress: server.envConfig.API_ADMINISTRATOR_USER_EMAIL_ADDRESS, - password: `password${faker.string.nanoid()}`, + password: `password${faker.string.ulid()}`, }, }, }); diff --git a/test/routes/graphql/Query/user.test.ts b/test/routes/graphql/Query/user.test.ts index 214d87e58eb..5f26af9d742 100644 --- a/test/routes/graphql/Query/user.test.ts +++ b/test/routes/graphql/Query/user.test.ts @@ -81,7 +81,7 @@ suite("Query field user", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/User/creator.test.ts b/test/routes/graphql/User/creator.test.ts index 82d945d1a16..2ce18ebd251 100644 --- a/test/routes/graphql/User/creator.test.ts +++ b/test/routes/graphql/User/creator.test.ts @@ -88,7 +88,7 @@ suite("User field creator", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -177,7 +177,7 @@ suite("User field creator", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -191,7 +191,7 @@ suite("User field creator", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -268,7 +268,7 @@ suite("User field creator", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -294,7 +294,7 @@ suite("User field creator", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/User/updatedAt.test.ts b/test/routes/graphql/User/updatedAt.test.ts index 08f64fd01cb..990e139ba4e 100644 --- a/test/routes/graphql/User/updatedAt.test.ts +++ b/test/routes/graphql/User/updatedAt.test.ts @@ -89,7 +89,7 @@ suite("User field updatedAt", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -179,7 +179,7 @@ suite("User field updatedAt", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -211,10 +211,6 @@ suite("User field updatedAt", () => { }, ); - console.log("===================="); - console.log(userUpdatedAtResult.errors); - console.log("===================="); - expect(userUpdatedAtResult.data.user?.updatedAt).toEqual(null); expect(userUpdatedAtResult.errors).toEqual( expect.arrayContaining([ @@ -301,7 +297,7 @@ suite("User field updatedAt", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/User/updater.test.ts b/test/routes/graphql/User/updater.test.ts index 6a69ccef40f..d4c3fcde6f0 100644 --- a/test/routes/graphql/User/updater.test.ts +++ b/test/routes/graphql/User/updater.test.ts @@ -89,7 +89,7 @@ suite("User field updater", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -179,7 +179,7 @@ suite("User field updater", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", @@ -297,7 +297,7 @@ suite("User field updater", () => { }, variables: { input: { - emailAddress: `email${faker.string.nanoid()}@email.com`, + emailAddress: `email${faker.string.ulid()}@email.com`, isEmailAddressVerified: false, name: "name", password: "password", diff --git a/test/routes/graphql/documentNodes.ts b/test/routes/graphql/documentNodes.ts index 662b7b70c09..2d621539ebd 100644 --- a/test/routes/graphql/documentNodes.ts +++ b/test/routes/graphql/documentNodes.ts @@ -15,7 +15,6 @@ export const Mutation_createUser = authenticationToken user { address - avatarURI birthDate city countryCode @@ -43,7 +42,6 @@ export const Mutation_deleteCurrentUser = gql(`mutation Mutation_deleteCurrentUser { deleteCurrentUser { address - avatarURI birthDate city countryCode @@ -70,7 +68,6 @@ export const Mutation_deleteUser = gql(`mutation Mutation_deleteUser($input: MutationDeleteUserInput!) { deleteUser(input: $input) { address - avatarURI birthDate city countryCode @@ -99,7 +96,6 @@ export const Mutation_signUp = authenticationToken user { address - avatarURI birthDate city countryCode @@ -127,7 +123,6 @@ export const Mutation_updateCurrentUser = gql(`mutation Mutation_updateCurrentUser($input: MutationUpdateCurrentUserInput!) { updateCurrentUser(input: $input) { address - avatarURI birthDate city countryCode @@ -154,7 +149,6 @@ export const Mutation_updateUser = gql(`mutation Mutation_updateUser($input: MutationUpdateUserInput!) { updateUser(input: $input) { address - avatarURI birthDate city countryCode @@ -180,7 +174,6 @@ export const Mutation_updateUser = export const Query_currentUser = gql(`query Query_currentUser { currentUser { address - avatarURI birthDate city countryCode @@ -213,7 +206,6 @@ export const Query_signIn = gql(`query Query_signIn($input: QuerySignInInput!) { authenticationToken user { address - avatarURI birthDate city countryCode @@ -240,7 +232,6 @@ export const Query_signIn = gql(`query Query_signIn($input: QuerySignInInput!) { export const Query_user = gql(`query Query_user($input: QueryUserInput!) { user(input: $input) { address - avatarURI birthDate city countryCode @@ -268,7 +259,6 @@ export const Query_user_creator = user(input: $input) { creator { address - avatarURI birthDate city countryCode @@ -304,7 +294,6 @@ export const Query_user_updater = user(input: $input) { updater { address - avatarURI birthDate city countryCode diff --git a/test/routes/graphql/gql.tada-cache.d.ts b/test/routes/graphql/gql.tada-cache.d.ts index 750efb9df77..bbc4fc8301f 100644 --- a/test/routes/graphql/gql.tada-cache.d.ts +++ b/test/routes/graphql/gql.tada-cache.d.ts @@ -4,31 +4,31 @@ import type { TadaDocumentNode, $tada } from 'gql.tada'; declare module 'gql.tada' { interface setupCache { - "mutation Mutation_createUser($input: MutationCreateUserInput!) {\n createUser(input: $input){\n authenticationToken\n user {\n address\n avatarURI\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; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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?: "pg" | "at" | "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; avatarURI?: string | null | undefined; address?: string | null | undefined; }; }, void>; - "mutation Mutation_deleteCurrentUser {\n deleteCurrentUser {\n address\n avatarURI\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; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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_deleteUser($input: MutationDeleteUserInput!) {\n deleteUser(input: $input) {\n address\n avatarURI\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; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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 avatarURI\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<{ signUp: { authenticationToken: string | null; user: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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; 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; 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?: "pg" | "at" | "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; confirmedPassword: string; city?: string | null | undefined; birthDate?: string | null | undefined; avatarURI?: string | null | undefined; address?: string | null | undefined; }; }, void>; - "mutation Mutation_updateCurrentUser($input: MutationUpdateCurrentUserInput!) {\n updateCurrentUser(input: $input) {\n address\n avatarURI\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<{ updateCurrentUser: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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: { workPhoneNumber?: string | null | undefined; state?: string | null | undefined; postalCode?: string | null | undefined; password?: string | null | undefined; natalSex?: "female" | "intersex" | "male" | null | undefined; name?: string | null | undefined; mobilePhoneNumber?: string | null | undefined; maritalStatus?: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null | undefined; homePhoneNumber?: string | null | undefined; employmentStatus?: "full_time" | "part_time" | "unemployed" | null | undefined; emailAddress?: string | null | undefined; 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?: "pg" | "at" | "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; avatarURI?: string | null | undefined; address?: string | null | undefined; }; }, void>; - "mutation Mutation_updateUser($input: MutationUpdateUserInput!) {\n updateUser(input: $input) {\n address\n avatarURI\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<{ updateUser: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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: { workPhoneNumber?: string | null | undefined; state?: string | null | undefined; role?: "administrator" | "regular" | null | undefined; postalCode?: string | null | undefined; password?: string | null | undefined; natalSex?: "female" | "intersex" | "male" | null | undefined; name?: string | null | undefined; mobilePhoneNumber?: string | null | undefined; maritalStatus?: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null | undefined; isEmailAddressVerified?: boolean | null | undefined; id: string; homePhoneNumber?: string | null | undefined; employmentStatus?: "full_time" | "part_time" | "unemployed" | null | undefined; emailAddress?: string | null | undefined; 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?: "pg" | "at" | "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; avatarURI?: string | null | undefined; address?: string | null | undefined; }; }, void>; - "query Query_currentUser {\n currentUser {\n address\n avatarURI\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<{ currentUser: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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_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_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}": + TadaDocumentNode<{ signUp: { 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; 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; 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; confirmedPassword: string; city?: string | null | undefined; birthDate?: string | null | undefined; avatar?: unknown; address?: string | null | undefined; }; }, void>; + "mutation Mutation_updateCurrentUser($input: MutationUpdateCurrentUserInput!) {\n updateCurrentUser(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<{ updateCurrentUser: { 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: { workPhoneNumber?: string | null | undefined; state?: string | null | undefined; postalCode?: string | null | undefined; password?: string | null | undefined; natalSex?: "female" | "intersex" | "male" | null | undefined; name?: string | null | undefined; mobilePhoneNumber?: string | null | undefined; maritalStatus?: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null | undefined; homePhoneNumber?: string | null | undefined; employmentStatus?: "full_time" | "part_time" | "unemployed" | null | undefined; emailAddress?: string | null | undefined; 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_updateUser($input: MutationUpdateUserInput!) {\n updateUser(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<{ updateUser: { 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: { workPhoneNumber?: string | null | undefined; state?: string | null | undefined; role?: "administrator" | "regular" | null | undefined; postalCode?: string | null | undefined; password?: string | null | undefined; natalSex?: "female" | "intersex" | "male" | null | undefined; name?: string | null | undefined; mobilePhoneNumber?: string | null | undefined; maritalStatus?: "divorced" | "engaged" | "married" | "seperated" | "single" | "widowed" | null | undefined; isEmailAddressVerified?: boolean | null | undefined; id: string; homePhoneNumber?: string | null | undefined; employmentStatus?: "full_time" | "part_time" | "unemployed" | null | undefined; emailAddress?: string | null | undefined; 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>; + "query Query_currentUser {\n currentUser {\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<{ currentUser: { 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>; "query Query_renewAuthenticationToken {\n renewAuthenticationToken\n}": TadaDocumentNode<{ renewAuthenticationToken: string | null; }, {}, void>; - "query Query_signIn($input: QuerySignInInput!) {\n signIn(input: $input) {\n authenticationToken\n user {\n address\n avatarURI\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<{ signIn: { authenticationToken: string | null; user: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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: { password: string; emailAddress: string; }; }, void>; - "query Query_user($input: QueryUserInput!) {\n user(input: $input) {\n address\n avatarURI\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<{ user: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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>; - "query Query_user_creator($input: QueryUserInput!) {\n user(input: $input) {\n creator {\n address\n avatarURI\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<{ user: { creator: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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: { id: string; }; }, void>; + "query Query_signIn($input: QuerySignInInput!) {\n signIn(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<{ signIn: { 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: { password: string; emailAddress: string; }; }, void>; + "query Query_user($input: QueryUserInput!) {\n user(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<{ 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; }, { input: { id: string; }; }, void>; + "query Query_user_creator($input: QueryUserInput!) {\n user(input: $input) {\n creator {\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<{ user: { creator: { 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: { id: string; }; }, void>; "query Query_user_updatedAt($input: QueryUserInput!) {\n user(input: $input) {\n updatedAt\n }\n}": TadaDocumentNode<{ user: { updatedAt: string | null; } | null; }, { input: { id: string; }; }, void>; - "query Query_user_updater($input: QueryUserInput!) {\n user(input: $input) {\n updater {\n address\n avatarURI\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<{ user: { updater: { address: string | null; avatarURI: string | null; birthDate: string | null; city: string | null; countryCode: "pg" | "at" | "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: { id: string; }; }, void>; + "query Query_user_updater($input: QueryUserInput!) {\n user(input: $input) {\n updater {\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<{ user: { updater: { 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: { id: string; }; }, void>; } } diff --git a/test/routes/graphql/gql.tada.d.ts b/test/routes/graphql/gql.tada.d.ts index 6354209f1e5..3e7684a2da9 100644 --- a/test/routes/graphql/gql.tada.d.ts +++ b/test/routes/graphql/gql.tada.d.ts @@ -3,13 +3,25 @@ export type introspection_types = { 'Advertisement': { kind: 'OBJECT'; name: 'Advertisement'; fields: { 'attachments': { name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AdvertisementAttachment'; 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; } }; 'endAt': { name: 'endAt'; type: { kind: 'SCALAR'; name: 'DateTime'; 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; } }; 'startAt': { name: 'startAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'type': { name: 'type'; type: { kind: 'ENUM'; name: 'AdvertisementType'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; - 'AdvertisementAttachment': { kind: 'OBJECT'; name: 'AdvertisementAttachment'; fields: { 'type': { name: 'type'; type: { kind: 'ENUM'; name: 'AdvertisementAttachmentType'; ofType: null; } }; 'uri': { name: 'uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; - 'AdvertisementAttachmentInput': { kind: 'INPUT_OBJECT'; name: 'AdvertisementAttachmentInput'; isOneOf: false; inputFields: [{ name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'AdvertisementAttachmentType'; ofType: null; }; }; defaultValue: null }, { name: 'uri'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; - 'AdvertisementAttachmentType': { name: 'AdvertisementAttachmentType'; enumValues: 'image' | 'video'; }; + 'AdvertisementAttachment': { kind: 'OBJECT'; name: 'AdvertisementAttachment'; fields: { 'mimeType': { name: 'mimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'url': { name: 'url'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; 'AdvertisementType': { name: 'AdvertisementType'; enumValues: 'banner' | 'menu' | 'pop_up'; }; + 'AgendaFolder': { kind: 'OBJECT'; name: 'AgendaFolder'; fields: { 'childFolders': { name: 'childFolders'; type: { kind: 'OBJECT'; name: 'AgendaFolderChildFoldersConnection'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'event': { name: 'event'; type: { kind: 'OBJECT'; name: 'Event'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'isAgendaItemFolder': { name: 'isAgendaItemFolder'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'items': { name: 'items'; type: { kind: 'OBJECT'; name: 'AgendaFolderItemsConnection'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'parentFolder': { name: 'parentFolder'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'AgendaFolderChildFoldersConnection': { kind: 'OBJECT'; name: 'AgendaFolderChildFoldersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'AgendaFolderChildFoldersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'AgendaFolderChildFoldersConnectionEdge': { kind: 'OBJECT'; name: 'AgendaFolderChildFoldersConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; }; }; + 'AgendaFolderItemsConnection': { kind: 'OBJECT'; name: 'AgendaFolderItemsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'AgendaFolderItemsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'AgendaFolderItemsConnectionEdge': { kind: 'OBJECT'; name: 'AgendaFolderItemsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'AgendaItem'; ofType: null; } }; }; }; + 'AgendaItem': { kind: 'OBJECT'; name: 'AgendaItem'; 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; } }; 'duration': { name: 'duration'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'event': { name: 'event'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'key': { name: 'key'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'type': { name: 'type'; type: { kind: 'ENUM'; name: 'AgendaItemType'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'AgendaItemType': { name: 'AgendaItemType'; enumValues: 'general' | 'note' | 'scripture' | 'song'; }; 'AuthenticationPayload': { kind: 'OBJECT'; name: 'AuthenticationPayload'; fields: { 'authenticationToken': { name: 'authenticationToken'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'user': { name: 'user'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'BigInt': unknown; 'Boolean': unknown; + 'Chat': { kind: 'OBJECT'; name: 'Chat'; fields: { 'avatarMimeType': { name: 'avatarMimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'avatarURL': { name: 'avatarURL'; 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; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'members': { name: 'members'; type: { kind: 'OBJECT'; name: 'ChatMembersConnection'; ofType: null; } }; 'messages': { name: 'messages'; type: { kind: 'OBJECT'; name: 'ChatMessagesConnection'; 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; } }; }; }; + '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; } }; }; }; + '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; } }; }; }; '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; } }; }; }; @@ -19,6 +31,12 @@ export type introspection_types = { 'Date': unknown; 'DateTime': unknown; 'EmailAddress': unknown; + 'Event': { kind: 'OBJECT'; name: 'Event'; fields: { 'agendaFolders': { name: 'agendaFolders'; type: { kind: 'OBJECT'; name: 'EventAgendaFoldersConnection'; ofType: null; } }; 'attachments': { name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'EventAttachment'; 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; } }; 'endAt': { name: 'endAt'; type: { kind: 'SCALAR'; name: 'DateTime'; 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; } }; 'startAt': { name: 'startAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'venues': { name: 'venues'; type: { kind: 'OBJECT'; name: 'EventVenuesConnection'; ofType: null; } }; }; }; + 'EventAgendaFoldersConnection': { kind: 'OBJECT'; name: 'EventAgendaFoldersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'EventAgendaFoldersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'EventAgendaFoldersConnectionEdge': { kind: 'OBJECT'; name: 'EventAgendaFoldersConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; }; }; + 'EventAttachment': { kind: 'OBJECT'; name: 'EventAttachment'; fields: { 'mimeType': { name: 'mimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'url': { name: 'url'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'EventVenuesConnection': { kind: 'OBJECT'; name: 'EventVenuesConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'EventVenuesConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'EventVenuesConnectionEdge': { kind: 'OBJECT'; name: 'EventVenuesConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; }; }; 'Fund': { kind: 'OBJECT'; name: 'Fund'; fields: { 'campaigns': { name: 'campaigns'; type: { kind: 'OBJECT'; name: 'FundCampaignsConnection'; 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; }; } }; 'isTaxDeductible': { name: 'isTaxDeductible'; type: { kind: 'SCALAR'; name: 'Boolean'; 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; } }; }; }; 'FundCampaign': { kind: 'OBJECT'; name: 'FundCampaign'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'creator': { name: 'creator'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'currencyCode': { name: 'currencyCode'; type: { kind: 'ENUM'; name: 'Iso4217CurrencyCode'; ofType: null; } }; 'endAt': { name: 'endAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'fund': { name: 'fund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'goalAmount': { name: 'goalAmount'; type: { kind: 'SCALAR'; name: 'Int'; 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; } }; 'pledgedAmount': { name: 'pledgedAmount'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; } }; 'pledges': { name: 'pledges'; type: { kind: 'OBJECT'; name: 'FundCampaignPledgesConnection'; ofType: null; } }; 'startAt': { name: 'startAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; 'FundCampaignPledge': { kind: 'OBJECT'; name: 'FundCampaignPledge'; fields: { 'amount': { name: 'amount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'campaign': { name: 'campaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; 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; }; } }; 'note': { name: 'note'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'pledger': { name: 'pledger'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; @@ -30,22 +48,37 @@ export type introspection_types = { 'Int': unknown; 'Iso3166Alpha2CountryCode': { name: 'Iso3166Alpha2CountryCode'; enumValues: 'ad' | 'ae' | 'af' | 'ag' | 'ai' | 'al' | 'am' | 'ao' | 'aq' | 'ar' | 'as' | 'at' | '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' | 'pg' | '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'; }; 'Iso4217CurrencyCode': { name: 'Iso4217CurrencyCode'; enumValues: 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWG'; }; - 'Mutation': { kind: 'OBJECT'; name: 'Mutation'; fields: { 'createAdvertisement': { name: 'createAdvertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'createComment': { name: 'createComment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'createCommentVote': { name: 'createCommentVote'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'createFund': { name: 'createFund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'createFundCampaign': { name: 'createFundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'createFundCampaignPledge': { name: 'createFundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'createOrganization': { name: 'createOrganization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'createOrganizationMembership': { name: 'createOrganizationMembership'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'createPost': { name: 'createPost'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'createPostVote': { name: 'createPostVote'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'createTag': { name: 'createTag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'createUser': { name: 'createUser'; type: { kind: 'OBJECT'; name: 'AuthenticationPayload'; ofType: null; } }; 'deleteAdvertisement': { name: 'deleteAdvertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'deleteComment': { name: 'deleteComment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'deleteCommentVote': { name: 'deleteCommentVote'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'deleteCurrentUser': { name: 'deleteCurrentUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'deleteFund': { name: 'deleteFund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'deleteFundCampaign': { name: 'deleteFundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'deleteFundCampaignPledge': { name: 'deleteFundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'deleteOrganization': { name: 'deleteOrganization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'deleteOrganizationMembership': { name: 'deleteOrganizationMembership'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'deletePost': { name: 'deletePost'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'deletePostVote': { name: 'deletePostVote'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'deleteTag': { name: 'deleteTag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'deleteUser': { name: 'deleteUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'signUp': { name: 'signUp'; type: { kind: 'OBJECT'; name: 'AuthenticationPayload'; ofType: null; } }; 'updateAdvertisement': { name: 'updateAdvertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'updateComment': { name: 'updateComment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'updateCommentVote': { name: 'updateCommentVote'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'updateCurrentUser': { name: 'updateCurrentUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'updateFund': { name: 'updateFund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'updateFundCampaign': { name: 'updateFundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'updateFundCampaignPledge': { name: 'updateFundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'updateOrganization': { name: 'updateOrganization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updateOrganizationMembership': { name: 'updateOrganizationMembership'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updatePost': { name: 'updatePost'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'updatePostVote': { name: 'updatePostVote'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'updateTag': { name: 'updateTag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'updateUser': { name: 'updateUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; - 'MutationCreateAdvertisementInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateAdvertisementInput'; isOneOf: false; inputFields: [{ name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AdvertisementAttachmentInput'; 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 }, { name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'AdvertisementType'; ofType: null; }; }; defaultValue: null }]; }; + 'Mutation': { kind: 'OBJECT'; name: 'Mutation'; fields: { 'createAdvertisement': { name: 'createAdvertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'createAgendaFolder': { name: 'createAgendaFolder'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; 'createAgendaItem': { name: 'createAgendaItem'; type: { kind: 'OBJECT'; name: 'AgendaItem'; ofType: null; } }; 'createChat': { name: 'createChat'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'createChatMembership': { name: 'createChatMembership'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'createChatMessage': { name: 'createChatMessage'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; 'createComment': { name: 'createComment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'createCommentVote': { name: 'createCommentVote'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'createEvent': { name: 'createEvent'; type: { kind: 'OBJECT'; name: 'Event'; ofType: null; } }; 'createFund': { name: 'createFund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'createFundCampaign': { name: 'createFundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'createFundCampaignPledge': { name: 'createFundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'createOrganization': { name: 'createOrganization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'createOrganizationMembership': { name: 'createOrganizationMembership'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'createPost': { name: 'createPost'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'createPostVote': { name: 'createPostVote'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'createTag': { name: 'createTag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'createTagFolder': { name: 'createTagFolder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'createUser': { name: 'createUser'; type: { kind: 'OBJECT'; name: 'AuthenticationPayload'; ofType: null; } }; 'createVenue': { name: 'createVenue'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; 'createVenueBooking': { name: 'createVenueBooking'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; 'deleteAdvertisement': { name: 'deleteAdvertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'deleteAgendaFolder': { name: 'deleteAgendaFolder'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; 'deleteAgendaItem': { name: 'deleteAgendaItem'; type: { kind: 'OBJECT'; name: 'AgendaItem'; ofType: null; } }; 'deleteChat': { name: 'deleteChat'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'deleteChatMembership': { name: 'deleteChatMembership'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'deleteChatMessage': { name: 'deleteChatMessage'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; 'deleteComment': { name: 'deleteComment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'deleteCommentVote': { name: 'deleteCommentVote'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'deleteCurrentUser': { name: 'deleteCurrentUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'deleteEvent': { name: 'deleteEvent'; type: { kind: 'OBJECT'; name: 'Event'; ofType: null; } }; 'deleteFund': { name: 'deleteFund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'deleteFundCampaign': { name: 'deleteFundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'deleteFundCampaignPledge': { name: 'deleteFundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'deleteOrganization': { name: 'deleteOrganization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'deleteOrganizationMembership': { name: 'deleteOrganizationMembership'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'deletePost': { name: 'deletePost'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'deletePostVote': { name: 'deletePostVote'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'deleteTag': { name: 'deleteTag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'deleteTagFolder': { name: 'deleteTagFolder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'deleteUser': { name: 'deleteUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'deleteVenue': { name: 'deleteVenue'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; 'deleteVenueBooking': { name: 'deleteVenueBooking'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; 'signUp': { name: 'signUp'; type: { kind: 'OBJECT'; name: 'AuthenticationPayload'; ofType: null; } }; 'updateAdvertisement': { name: 'updateAdvertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'updateAgendaFolder': { name: 'updateAgendaFolder'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; 'updateAgendaItem': { name: 'updateAgendaItem'; type: { kind: 'OBJECT'; name: 'AgendaItem'; ofType: null; } }; 'updateChat': { name: 'updateChat'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'updateChatMembership': { name: 'updateChatMembership'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'updateChatMessage': { name: 'updateChatMessage'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; 'updateComment': { name: 'updateComment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'updateCommentVote': { name: 'updateCommentVote'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'updateCurrentUser': { name: 'updateCurrentUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'updateEvent': { name: 'updateEvent'; type: { kind: 'OBJECT'; name: 'Event'; ofType: null; } }; 'updateFund': { name: 'updateFund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'updateFundCampaign': { name: 'updateFundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'updateFundCampaignPledge': { name: 'updateFundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'updateOrganization': { name: 'updateOrganization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updateOrganizationMembership': { name: 'updateOrganizationMembership'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'updatePost': { name: 'updatePost'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'updatePostVote': { name: 'updatePostVote'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'updateTag': { name: 'updateTag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'updateTagFolder': { name: 'updateTagFolder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'updateUser': { name: 'updateUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'updateVenue': { name: 'updateVenue'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; }; }; + 'MutationCreateAdvertisementInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateAdvertisementInput'; 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 }, { name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'AdvertisementType'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationCreateAgendaFolderInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateAgendaFolderInput'; isOneOf: false; inputFields: [{ name: 'eventId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'isAgendaItemFolder'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'parentFolderId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }]; }; + '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 }]; }; '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 }]; }; 'MutationCreateFundCampaignInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateFundCampaignInput'; isOneOf: false; inputFields: [{ name: 'currencyCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'Iso4217CurrencyCode'; ofType: null; }; }; defaultValue: null }, { name: 'endAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; }; defaultValue: null }, { name: 'fundId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'goalAmount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'startAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateFundCampaignPledgeInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateFundCampaignPledgeInput'; isOneOf: false; inputFields: [{ name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; }; defaultValue: null }, { name: 'campaignId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'note'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'pledgerId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreateFundInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateFundInput'; isOneOf: false; inputFields: [{ name: 'isTaxDeductible'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; 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 }]; }; - 'MutationCreateOrganizationInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateOrganizationInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; 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: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'MutationCreateOrganizationInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateOrganizationInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; 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: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; 'MutationCreateOrganizationMembershipInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateOrganizationMembershipInput'; isOneOf: false; inputFields: [{ name: 'memberId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'role'; type: { kind: 'ENUM'; name: 'OrganizationMembershipRole'; ofType: null; }; defaultValue: null }]; }; - 'MutationCreatePostInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreatePostInput'; isOneOf: false; inputFields: [{ name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'PostAttachmentInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'caption'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'isPinned'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationCreatePostInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreatePostInput'; 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: 'caption'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'isPinned'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationCreatePostVoteInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreatePostVoteInput'; isOneOf: false; inputFields: [{ name: 'postId'; 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: 'PostVoteType'; ofType: null; }; }; defaultValue: null }]; }; - 'MutationCreateTagInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateTagInput'; isOneOf: false; inputFields: [{ name: 'isFolder'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; 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: 'parentTagId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }]; }; - 'MutationCreateUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateUserInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'isEmailAddressVerified'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'role'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'UserRole'; ofType: null; }; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; + 'MutationCreateTagFolderInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateTagFolderInput'; isOneOf: false; inputFields: [{ 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: 'parentFolderId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }]; }; + 'MutationCreateTagInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateTagInput'; isOneOf: false; inputFields: [{ name: 'folderId'; type: { kind: 'SCALAR'; name: 'ID'; 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 }]; }; + 'MutationCreateUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateUserInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'isEmailAddressVerified'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'role'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'UserRole'; ofType: null; }; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; + 'MutationCreateVenueBookingInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateVenueBookingInput'; isOneOf: false; inputFields: [{ name: 'eventId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'venueId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationCreateVenueInput': { kind: 'INPUT_OBJECT'; name: 'MutationCreateVenueInput'; 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: '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 }]; }; 'MutationDeleteAdvertisementInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteAdvertisementInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteAgendaFolderInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteAgendaFolderInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteAgendaItemInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteAgendaItemInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteChatInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteChatInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteChatMembershipInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteChatMembershipInput'; 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 }]; }; + 'MutationDeleteChatMessageInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteChatMessageInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteCommentInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteCommentInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteCommentVoteInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteCommentVoteInput'; isOneOf: false; inputFields: [{ name: 'commentId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'creatorId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteEventInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteEventInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteFundCampaignInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteFundCampaignInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteFundCampaignPledgeInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteFundCampaignPledgeInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteFundInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteFundInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; @@ -53,25 +86,40 @@ export type introspection_types = { 'MutationDeleteOrganizationMembershipInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteOrganizationMembershipInput'; isOneOf: false; inputFields: [{ name: 'memberId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeletePostInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeletePostInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeletePostVoteInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeletePostVoteInput'; isOneOf: false; inputFields: [{ name: 'creatorId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'postId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteTagFolderInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteTagFolderInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteTagInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteTagInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationDeleteUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteUserInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; - 'MutationSignUpInput': { kind: 'INPUT_OBJECT'; name: 'MutationSignUpInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'confirmedPassword'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; + 'MutationDeleteVenueBookingInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteVenueBookingInput'; isOneOf: false; inputFields: [{ name: 'eventId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'venueId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationDeleteVenueInput': { kind: 'INPUT_OBJECT'; name: 'MutationDeleteVenueInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationSignUpInput': { kind: 'INPUT_OBJECT'; name: 'MutationSignUpInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'confirmedPassword'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdateAdvertisementInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateAdvertisementInput'; isOneOf: false; inputFields: [{ name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'endAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'startAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }, { name: 'type'; type: { kind: 'ENUM'; name: 'AdvertisementType'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateAgendaFolderInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateAgendaFolderInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'parentFolderId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateAgendaItemInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateAgendaItemInput'; 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: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'id'; 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: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateChatInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateChatInput'; 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: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateChatMembershipInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateChatMembershipInput'; 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: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ChatMembershipRole'; ofType: null; }; }; defaultValue: null }]; }; + 'MutationUpdateChatMessageInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateChatMessageInput'; isOneOf: false; inputFields: [{ name: 'body'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationUpdateCommentInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateCommentInput'; isOneOf: false; inputFields: [{ name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; }; 'MutationUpdateCommentVoteInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateCommentVoteInput'; 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 }]; }; - 'MutationUpdateCurrentUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateCurrentUserInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateCurrentUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateCurrentUserInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateEventInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateEventInput'; isOneOf: false; inputFields: [{ name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'endAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'startAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdateFundCampaignInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateFundCampaignInput'; isOneOf: false; inputFields: [{ name: 'endAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }, { name: 'goalAmount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'startAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdateFundCampaignPledgeInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateFundCampaignPledgeInput'; isOneOf: false; inputFields: [{ name: 'amount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'note'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdateFundInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateFundInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'isTaxDeductible'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; - 'MutationUpdateOrganizationInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateOrganizationInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateOrganizationInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateOrganizationInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdateOrganizationMembershipInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateOrganizationMembershipInput'; isOneOf: false; inputFields: [{ name: 'memberId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'role'; type: { kind: 'ENUM'; name: 'OrganizationMembershipRole'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdatePostInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdatePostInput'; isOneOf: false; inputFields: [{ name: 'caption'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'isPinned'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }]; }; 'MutationUpdatePostVoteInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdatePostVoteInput'; isOneOf: false; inputFields: [{ name: 'postId'; 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: 'PostVoteType'; ofType: null; }; }; defaultValue: null }]; }; - 'MutationUpdateTagInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateTagInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'parentTagId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }]; }; - 'MutationUpdateUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateUserInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'isEmailAddressVerified'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'role'; type: { kind: 'ENUM'; name: 'UserRole'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; - 'Organization': { kind: 'OBJECT'; name: 'Organization'; fields: { 'address': { name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'advertisements': { name: 'advertisements'; type: { kind: 'OBJECT'; name: 'OrganizationAdvertisementsConnection'; ofType: null; } }; 'avatarURI': { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'city': { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'countryCode': { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; 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; } }; 'funds': { name: 'funds'; type: { kind: 'OBJECT'; name: 'OrganizationFundsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'members': { name: 'members'; type: { kind: 'OBJECT'; name: 'OrganizationMembersConnection'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'pinnedPosts': { name: 'pinnedPosts'; type: { kind: 'OBJECT'; name: 'OrganizationPinnedPostsConnection'; ofType: null; } }; 'pinnedPostsCount': { name: 'pinnedPostsCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'postalCode': { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'posts': { name: 'posts'; type: { kind: 'OBJECT'; name: 'OrganizationPostsConnection'; ofType: null; } }; 'postsCount': { name: 'postsCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'state': { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'tags': { name: 'tags'; type: { kind: 'OBJECT'; name: 'OrganizationTagsConnection'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'MutationUpdateTagFolderInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateTagFolderInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'parentFolderId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateTagInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateTagInput'; isOneOf: false; inputFields: [{ name: 'folderId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateUserInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateUserInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'SCALAR'; name: 'Upload'; ofType: null; }; defaultValue: null }, { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; }; defaultValue: null }, { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; }; defaultValue: null }, { name: 'emailAddress'; type: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; defaultValue: null }, { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; }; defaultValue: null }, { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'isEmailAddressVerified'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; }; defaultValue: null }, { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; }; defaultValue: null }, { name: 'password'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'role'; type: { kind: 'ENUM'; name: 'UserRole'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; }; defaultValue: null }]; }; + 'MutationUpdateVenueInput': { kind: 'INPUT_OBJECT'; name: 'MutationUpdateVenueInput'; isOneOf: false; inputFields: [{ name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'Organization': { kind: 'OBJECT'; name: 'Organization'; fields: { 'address': { name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'advertisements': { name: 'advertisements'; type: { kind: 'OBJECT'; name: 'OrganizationAdvertisementsConnection'; ofType: null; } }; 'avatarMimeType': { name: 'avatarMimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'avatarURL': { name: 'avatarURL'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chats': { name: 'chats'; type: { kind: 'OBJECT'; name: 'OrganizationChatsConnection'; ofType: null; } }; 'city': { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'countryCode': { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; 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: 'OrganizationEventsConnection'; ofType: null; } }; 'funds': { name: 'funds'; type: { kind: 'OBJECT'; name: 'OrganizationFundsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'members': { name: 'members'; type: { kind: 'OBJECT'; name: 'OrganizationMembersConnection'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'pinnedPosts': { name: 'pinnedPosts'; type: { kind: 'OBJECT'; name: 'OrganizationPinnedPostsConnection'; ofType: null; } }; 'pinnedPostsCount': { name: 'pinnedPostsCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'postalCode': { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'posts': { name: 'posts'; type: { kind: 'OBJECT'; name: 'OrganizationPostsConnection'; ofType: null; } }; 'postsCount': { name: 'postsCount'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'state': { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'tagFolders': { name: 'tagFolders'; type: { kind: 'OBJECT'; name: 'OrganizationTagFoldersConnection'; ofType: null; } }; 'tags': { name: 'tags'; type: { kind: 'OBJECT'; name: 'OrganizationTagsConnection'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'venues': { name: 'venues'; type: { kind: 'OBJECT'; name: 'OrganizationVenuesConnection'; ofType: null; } }; }; }; 'OrganizationAdvertisementsConnection': { kind: 'OBJECT'; name: 'OrganizationAdvertisementsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationAdvertisementsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'OrganizationAdvertisementsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationAdvertisementsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; }; }; + 'OrganizationChatsConnection': { kind: 'OBJECT'; name: 'OrganizationChatsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationChatsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'OrganizationChatsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationChatsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; }; }; + 'OrganizationEventsConnection': { kind: 'OBJECT'; name: 'OrganizationEventsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationEventsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'OrganizationEventsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationEventsConnectionEdge'; 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; } }; }; }; 'OrganizationFundsConnection': { kind: 'OBJECT'; name: 'OrganizationFundsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationFundsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'OrganizationFundsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationFundsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; }; }; 'OrganizationMembersConnection': { kind: 'OBJECT'; name: 'OrganizationMembersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationMembersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; @@ -81,14 +129,16 @@ export type introspection_types = { 'OrganizationPinnedPostsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationPinnedPostsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; }; }; 'OrganizationPostsConnection': { kind: 'OBJECT'; name: 'OrganizationPostsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationPostsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'OrganizationPostsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationPostsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; }; }; + 'OrganizationTagFoldersConnection': { kind: 'OBJECT'; name: 'OrganizationTagFoldersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationTagFoldersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'OrganizationTagFoldersConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationTagFoldersConnectionEdge'; 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; } }; }; }; 'OrganizationTagsConnection': { kind: 'OBJECT'; name: 'OrganizationTagsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationTagsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'OrganizationTagsConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationTagsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; }; }; + 'OrganizationVenuesConnection': { kind: 'OBJECT'; name: 'OrganizationVenuesConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'OrganizationVenuesConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'OrganizationVenuesConnectionEdge': { kind: 'OBJECT'; name: 'OrganizationVenuesConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; }; }; 'PageInfo': { kind: 'OBJECT'; name: 'PageInfo'; fields: { 'endCursor': { name: 'endCursor'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'hasNextPage': { name: 'hasNextPage'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'hasPreviousPage': { name: 'hasPreviousPage'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'startCursor': { name: 'startCursor'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; 'PhoneNumber': unknown; 'Post': { kind: 'OBJECT'; name: 'Post'; fields: { 'attachments': { name: 'attachments'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PostAttachment'; ofType: null; }; }; } }; 'caption': { name: 'caption'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'comments': { name: 'comments'; type: { kind: 'OBJECT'; name: 'PostCommentsConnection'; ofType: null; } }; 'commentsCount': { name: 'commentsCount'; type: { kind: 'SCALAR'; name: 'Int'; 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: 'PostDownVotersConnection'; 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; }; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'pinnedAt': { name: 'pinnedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'upVoters': { name: 'upVoters'; type: { kind: 'OBJECT'; name: 'PostUpVotersConnection'; 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; } }; }; }; - 'PostAttachment': { kind: 'OBJECT'; name: 'PostAttachment'; fields: { 'type': { name: 'type'; type: { kind: 'ENUM'; name: 'PostAttachmentType'; ofType: null; } }; 'uri': { name: 'uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; - 'PostAttachmentInput': { kind: 'INPUT_OBJECT'; name: 'PostAttachmentInput'; isOneOf: false; inputFields: [{ name: 'type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'PostAttachmentType'; ofType: null; }; }; defaultValue: null }, { name: 'uri'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; - 'PostAttachmentType': { name: 'PostAttachmentType'; enumValues: 'image' | 'video'; }; + 'PostAttachment': { kind: 'OBJECT'; name: 'PostAttachment'; fields: { 'mimeType': { name: 'mimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'url': { name: 'url'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; 'PostCommentsConnection': { kind: 'OBJECT'; name: 'PostCommentsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PostCommentsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'PostCommentsConnectionEdge': { kind: 'OBJECT'; name: 'PostCommentsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; }; }; 'PostDownVotersConnection': { kind: 'OBJECT'; name: 'PostDownVotersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PostDownVotersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; @@ -96,22 +146,35 @@ export type introspection_types = { 'PostUpVotersConnection': { kind: 'OBJECT'; name: 'PostUpVotersConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'PostUpVotersConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; 'PostUpVotersConnectionEdge': { kind: 'OBJECT'; name: 'PostUpVotersConnectionEdge'; 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; } }; }; }; 'PostVoteType': { name: 'PostVoteType'; enumValues: 'down_vote' | 'up_vote'; }; - 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'advertisement': { name: 'advertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'comment': { name: 'comment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'currentUser': { name: 'currentUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'fund': { name: 'fund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'fundCampaign': { name: 'fundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'fundCampaignPledge': { name: 'fundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'post': { name: 'post'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'renewAuthenticationToken': { name: 'renewAuthenticationToken'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'signIn': { name: 'signIn'; type: { kind: 'OBJECT'; name: 'AuthenticationPayload'; ofType: null; } }; 'tag': { name: 'tag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'user': { name: 'user'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; + 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'advertisement': { name: 'advertisement'; type: { kind: 'OBJECT'; name: 'Advertisement'; ofType: null; } }; 'agendaFolder': { name: 'agendaFolder'; type: { kind: 'OBJECT'; name: 'AgendaFolder'; ofType: null; } }; 'agendaItem': { name: 'agendaItem'; type: { kind: 'OBJECT'; name: 'AgendaItem'; ofType: null; } }; 'chat': { name: 'chat'; type: { kind: 'OBJECT'; name: 'Chat'; ofType: null; } }; 'chatMessage': { name: 'chatMessage'; type: { kind: 'OBJECT'; name: 'ChatMessage'; ofType: null; } }; 'comment': { name: 'comment'; type: { kind: 'OBJECT'; name: 'Comment'; ofType: null; } }; 'currentUser': { name: 'currentUser'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'event': { name: 'event'; type: { kind: 'OBJECT'; name: 'Event'; ofType: null; } }; 'fund': { name: 'fund'; type: { kind: 'OBJECT'; name: 'Fund'; ofType: null; } }; 'fundCampaign': { name: 'fundCampaign'; type: { kind: 'OBJECT'; name: 'FundCampaign'; ofType: null; } }; 'fundCampaignPledge': { name: 'fundCampaignPledge'; type: { kind: 'OBJECT'; name: 'FundCampaignPledge'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'post': { name: 'post'; type: { kind: 'OBJECT'; name: 'Post'; ofType: null; } }; 'renewAuthenticationToken': { name: 'renewAuthenticationToken'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'signIn': { name: 'signIn'; type: { kind: 'OBJECT'; name: 'AuthenticationPayload'; ofType: null; } }; 'tag': { name: 'tag'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'tagFolder': { name: 'tagFolder'; type: { kind: 'OBJECT'; name: 'TagFolder'; ofType: null; } }; 'user': { name: 'user'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'venue': { name: 'venue'; type: { kind: 'OBJECT'; name: 'Venue'; ofType: null; } }; }; }; 'QueryAdvertisementInput': { kind: 'INPUT_OBJECT'; name: 'QueryAdvertisementInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryAgendaFolderInput': { kind: 'INPUT_OBJECT'; name: 'QueryAgendaFolderInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryAgendaItemInput': { kind: 'INPUT_OBJECT'; name: 'QueryAgendaItemInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryChatInput': { kind: 'INPUT_OBJECT'; name: 'QueryChatInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryChatMessageInput': { kind: 'INPUT_OBJECT'; name: 'QueryChatMessageInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryCommentInput': { kind: 'INPUT_OBJECT'; name: 'QueryCommentInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryEventInput': { kind: 'INPUT_OBJECT'; name: 'QueryEventInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryFundCampaignInput': { kind: 'INPUT_OBJECT'; name: 'QueryFundCampaignInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryFundCampaignPledgeInput': { kind: 'INPUT_OBJECT'; name: 'QueryFundCampaignPledgeInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryFundInput': { kind: 'INPUT_OBJECT'; name: 'QueryFundInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryOrganizationInput': { kind: 'INPUT_OBJECT'; name: 'QueryOrganizationInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryPostInput': { kind: 'INPUT_OBJECT'; name: 'QueryPostInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QuerySignInInput': { kind: 'INPUT_OBJECT'; name: 'QuerySignInInput'; isOneOf: false; inputFields: [{ name: 'emailAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; }; }; defaultValue: null }, { name: 'password'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryTagFolderInput': { kind: 'INPUT_OBJECT'; name: 'QueryTagFolderInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryTagInput': { kind: 'INPUT_OBJECT'; name: 'QueryTagInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'QueryUserInput': { kind: 'INPUT_OBJECT'; name: 'QueryUserInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'QueryVenueInput': { kind: 'INPUT_OBJECT'; name: 'QueryVenueInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'String': unknown; - 'Tag': { kind: 'OBJECT'; name: 'Tag'; fields: { 'childTags': { name: 'childTags'; type: { kind: 'OBJECT'; name: 'TagChildTagsConnection'; 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; }; } }; 'isFolder': { name: 'isFolder'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'parentTagFolder': { name: 'parentTagFolder'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; }; - 'TagChildTagsConnection': { kind: 'OBJECT'; name: 'TagChildTagsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'TagChildTagsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; - 'TagChildTagsConnectionEdge': { kind: 'OBJECT'; name: 'TagChildTagsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; }; }; - 'User': { kind: 'OBJECT'; name: 'User'; fields: { 'address': { name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'avatarURI': { name: 'avatarURI'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'birthDate': { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; } }; 'city': { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'countryCode': { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; 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; } }; 'educationGrade': { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; } }; 'emailAddress': { name: 'emailAddress'; type: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; } }; 'employmentStatus': { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; } }; 'homePhoneNumber': { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'isEmailAddressVerified': { name: 'isEmailAddressVerified'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'maritalStatus': { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; } }; 'mobilePhoneNumber': { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'natalSex': { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; } }; 'organizationsWhereMember': { name: 'organizationsWhereMember'; type: { kind: 'OBJECT'; name: 'UserOrganizationsWhereMemberConnection'; ofType: null; } }; 'postalCode': { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'role': { name: 'role'; type: { kind: 'ENUM'; name: 'UserRole'; ofType: null; } }; 'state': { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'workPhoneNumber': { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; } }; }; }; + '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; } }; }; }; + '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; } }; }; }; + 'TagFolderTagsConnection': { kind: 'OBJECT'; name: 'TagFolderTagsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'TagFolderTagsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; }; }; + 'TagFolderTagsConnectionEdge': { kind: 'OBJECT'; name: 'TagFolderTagsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'Tag'; ofType: null; } }; }; }; + 'Upload': unknown; + 'User': { kind: 'OBJECT'; name: 'User'; fields: { 'address': { name: 'address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'avatarMimeType': { name: 'avatarMimeType'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'avatarURL': { name: 'avatarURL'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'birthDate': { name: 'birthDate'; type: { kind: 'SCALAR'; name: 'Date'; ofType: null; } }; 'city': { name: 'city'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'countryCode': { name: 'countryCode'; type: { kind: 'ENUM'; name: 'Iso3166Alpha2CountryCode'; 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; } }; 'educationGrade': { name: 'educationGrade'; type: { kind: 'ENUM'; name: 'UserEducationGrade'; ofType: null; } }; 'emailAddress': { name: 'emailAddress'; type: { kind: 'SCALAR'; name: 'EmailAddress'; ofType: null; } }; 'employmentStatus': { name: 'employmentStatus'; type: { kind: 'ENUM'; name: 'UserEmploymentStatus'; ofType: null; } }; 'homePhoneNumber': { name: 'homePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'isEmailAddressVerified': { name: 'isEmailAddressVerified'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'maritalStatus': { name: 'maritalStatus'; type: { kind: 'ENUM'; name: 'UserMaritalStatus'; ofType: null; } }; 'mobilePhoneNumber': { name: 'mobilePhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'natalSex': { name: 'natalSex'; type: { kind: 'ENUM'; name: 'UserNatalSex'; ofType: null; } }; 'organizationsWhereMember': { name: 'organizationsWhereMember'; type: { kind: 'OBJECT'; name: 'UserOrganizationsWhereMemberConnection'; ofType: null; } }; 'postalCode': { name: 'postalCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'role': { name: 'role'; type: { kind: 'ENUM'; name: 'UserRole'; ofType: null; } }; 'state': { name: 'state'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'updater': { name: 'updater'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'workPhoneNumber': { name: 'workPhoneNumber'; type: { kind: 'SCALAR'; name: 'PhoneNumber'; ofType: null; } }; }; }; 'UserEducationGrade': { name: 'UserEducationGrade'; enumValues: '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' | 'kg' | 'no_grade' | 'pre_kg'; }; 'UserEmploymentStatus': { name: 'UserEmploymentStatus'; enumValues: 'full_time' | 'part_time' | 'unemployed'; }; 'UserMaritalStatus': { name: 'UserMaritalStatus'; enumValues: 'divorced' | 'engaged' | 'married' | 'seperated' | 'single' | 'widowed'; }; @@ -119,6 +182,10 @@ 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; } }; }; }; + '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; } }; }; }; }; /** An IntrospectionQuery representation of your schema. @@ -133,7 +200,7 @@ export type introspection = { name: never; query: 'Query'; mutation: 'Mutation'; - subscription: never; + subscription: 'Subscription'; types: introspection_types; }; diff --git a/test/server.ts b/test/server.ts index b2ddc642946..ff4da2b67c1 100644 --- a/test/server.ts +++ b/test/server.ts @@ -4,6 +4,7 @@ import { createServer } from "~/src/createServer"; import { envConfigSchema, envSchemaAjv } from "~/src/envConfigSchema"; const overrideEnvConfigSchema = Type.Object({ + API_MINIO_TEST_END_POINT: envConfigSchema.properties.API_MINIO_END_POINT, API_POSTGRES_TEST_HOST: envConfigSchema.properties.API_POSTGRES_HOST, }); @@ -15,6 +16,10 @@ const overrideEnvConfig = envSchema>({ export const server = await createServer({ envConfig: { + /** + * This makes the server test instance connect to the minio test server. + */ + API_MINIO_END_POINT: overrideEnvConfig.API_MINIO_TEST_END_POINT, /** * This makes the server test instance connect to the postgres test database. */ diff --git a/tsconfig.json b/tsconfig.json index 16e676382b4..d32ecd7895c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,6 @@ "moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */, "noEmit": true /* Disable emitting files from a compilation. */, "noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */, - "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */, "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */, "paths": { "~/src/*": ["./src/*"]