From c7e4b8e09c1413a71400590bc09877e8e9d66975 Mon Sep 17 00:00:00 2001 From: Matt Krick Date: Thu, 28 Mar 2024 17:53:56 -0700 Subject: [PATCH 1/2] fix: embedder doesn't dive deep into schema Signed-off-by: Matt Krick --- packages/embedder/tsconfig.json | 1 + packages/embedder/types/shared.d.ts | 1 - packages/server/database/rethinkDriver.ts | 2 +- packages/server/dataloader/customLoaderMakers.ts | 2 +- .../graphql/private/mutations/runScheduledJobs.ts | 2 -- packages/server/graphql/public/rootSchema.ts | 1 - .../server/integrations/gitlab/GitLabServerManager.ts | 2 +- .../postgres/types/{Meeting.ts => Meeting.d.ts} | 0 packages/server/types/custom.d.ts | 11 +++++++++++ packages/server/utils/analytics/analytics.ts | 11 +++++------ packages/server/utils/getGitHubRequest.ts | 2 +- 11 files changed, 21 insertions(+), 14 deletions(-) rename packages/server/postgres/types/{Meeting.ts => Meeting.d.ts} (100%) diff --git a/packages/embedder/tsconfig.json b/packages/embedder/tsconfig.json index b75106d1a8a..4789de56e28 100644 --- a/packages/embedder/tsconfig.json +++ b/packages/embedder/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "noEmit": true, "baseUrl": "../", "paths": { "parabol-server/*": ["server/*"], diff --git a/packages/embedder/types/shared.d.ts b/packages/embedder/types/shared.d.ts index 1d6610890e7..e94d0d14dea 100644 --- a/packages/embedder/types/shared.d.ts +++ b/packages/embedder/types/shared.d.ts @@ -1,2 +1 @@ import '../../server/types/modules' -import '../../server/types/webpackEnv' diff --git a/packages/server/database/rethinkDriver.ts b/packages/server/database/rethinkDriver.ts index 5f7311c0580..370482933b2 100644 --- a/packages/server/database/rethinkDriver.ts +++ b/packages/server/database/rethinkDriver.ts @@ -4,7 +4,7 @@ import SlackAuth from '../database/types/SlackAuth' import SlackNotification from '../database/types/SlackNotification' import TeamInvitation from '../database/types/TeamInvitation' import TeamMember from '../database/types/TeamMember' -import {ScheduledJobUnion} from '../graphql/private/mutations/runScheduledJobs' +import {ScheduledJobUnion} from '../types/custom' import {AnyMeeting, AnyMeetingSettings, AnyMeetingTeamMember} from '../postgres/types/Meeting' import getRethinkConfig from './getRethinkConfig' import {R} from './stricterR' diff --git a/packages/server/dataloader/customLoaderMakers.ts b/packages/server/dataloader/customLoaderMakers.ts index ac7e1ea6ec7..f10dfd1f257 100644 --- a/packages/server/dataloader/customLoaderMakers.ts +++ b/packages/server/dataloader/customLoaderMakers.ts @@ -5,11 +5,11 @@ import getRethink, {RethinkSchema} from '../database/rethinkDriver' import {RDatum} from '../database/stricterR' import MeetingSettingsTeamPrompt from '../database/types/MeetingSettingsTeamPrompt' import MeetingTemplate from '../database/types/MeetingTemplate' +import Organization from '../database/types/Organization' import OrganizationUser from '../database/types/OrganizationUser' import {Reactable, ReactableEnum} from '../database/types/Reactable' import Task, {TaskStatusEnum} from '../database/types/Task' import isValid from '../graphql/isValid' -import {Organization} from '../graphql/public/resolverTypes' import {SAMLSource} from '../graphql/public/types/SAML' import getKysely from '../postgres/getKysely' import {TeamMeetingTemplate} from '../postgres/pg.d' diff --git a/packages/server/graphql/private/mutations/runScheduledJobs.ts b/packages/server/graphql/private/mutations/runScheduledJobs.ts index aebb1e5eafe..5317aff0147 100644 --- a/packages/server/graphql/private/mutations/runScheduledJobs.ts +++ b/packages/server/graphql/private/mutations/runScheduledJobs.ts @@ -40,8 +40,6 @@ const processMeetingStageTimeLimits = async ( }) } -export type ScheduledJobUnion = ScheduledJobMeetingStageTimeLimit | ScheduledTeamLimitsJob - const processJob = async (job: Selectable, dataLoader: DataLoaderWorker) => { const pg = getKysely() const res = await pg.deleteFrom('ScheduledJob').where('id', '=', job.id).executeTakeFirst() diff --git a/packages/server/graphql/public/rootSchema.ts b/packages/server/graphql/public/rootSchema.ts index b6f1d26fad2..e65b1459189 100644 --- a/packages/server/graphql/public/rootSchema.ts +++ b/packages/server/graphql/public/rootSchema.ts @@ -99,5 +99,4 @@ const addRequestors = (schema: GraphQLSchema) => { const rootSchema = addRequestors(resolveTypesForMutationPayloads(parabolWithNestedResolversSchema)) -export type RootSchema = typeof rootSchema export default rootSchema diff --git a/packages/server/integrations/gitlab/GitLabServerManager.ts b/packages/server/integrations/gitlab/GitLabServerManager.ts index 2ffcfa826bf..dd44a3a5525 100644 --- a/packages/server/integrations/gitlab/GitLabServerManager.ts +++ b/packages/server/integrations/gitlab/GitLabServerManager.ts @@ -9,8 +9,8 @@ import getIssue from '../../graphql/nestedSchema/GitLab/queries/getIssue.graphql import getProfile from '../../graphql/nestedSchema/GitLab/queries/getProfile.graphql' import getProjectIssues from '../../graphql/nestedSchema/GitLab/queries/getProjectIssues.graphql' import getProjects from '../../graphql/nestedSchema/GitLab/queries/getProjects.graphql' -import {RootSchema} from '../../graphql/public/rootSchema' import {IGetTeamMemberIntegrationAuthQueryResult} from '../../postgres/queries/generated/getTeamMemberIntegrationAuthQuery' +import {RootSchema} from '../../types/custom' import { CreateIssueMutation, CreateNoteMutation, diff --git a/packages/server/postgres/types/Meeting.ts b/packages/server/postgres/types/Meeting.d.ts similarity index 100% rename from packages/server/postgres/types/Meeting.ts rename to packages/server/postgres/types/Meeting.d.ts diff --git a/packages/server/types/custom.d.ts b/packages/server/types/custom.d.ts index 2fc4dba2ce8..aae67c270cd 100644 --- a/packages/server/types/custom.d.ts +++ b/packages/server/types/custom.d.ts @@ -1,5 +1,9 @@ +import {GraphQLSchema} from 'graphql' +import type nestGitHubEndpoint from 'nest-graphql-endpoint/lib/nestGitHubEndpoint' import '../../client/types/reactHTML4' import type AuthToken from '../database/types/AuthToken' +import type ScheduledJobMeetingStageTimeLimit from '../database/types/ScheduledJobMetingStageTimeLimit' +import type ScheduledTeamLimitsJob from '../database/types/ScheduledTeamLimitsJob' export interface OAuth2Success { access_token: string token_type: string @@ -35,3 +39,10 @@ export interface GQLRequest { // Datadog opentracing span of the calling server carrier?: any } + +export type ScheduledJobUnion = ScheduledJobMeetingStageTimeLimit | ScheduledTeamLimitsJob + +export type RootSchema = GraphQLSchema & { + githubRequest: ReturnType['githubRequest'] + gitlabRequest: ReturnType['githubRequest'] +} diff --git a/packages/server/utils/analytics/analytics.ts b/packages/server/utils/analytics/analytics.ts index a4cbc61f189..305839e2651 100644 --- a/packages/server/utils/analytics/analytics.ts +++ b/packages/server/utils/analytics/analytics.ts @@ -5,9 +5,12 @@ import Meeting from '../../database/types/Meeting' import MeetingMember from '../../database/types/MeetingMember' import MeetingRetrospective from '../../database/types/MeetingRetrospective' import MeetingTemplate from '../../database/types/MeetingTemplate' -import {Reactable} from '../../database/types/Reactable' +import {Reactable, ReactableEnum} from '../../database/types/Reactable' +import {SlackNotificationEventEnum} from '../../database/types/SlackNotification' import {TaskServiceEnum} from '../../database/types/Task' -import {ReactableEnum} from '../../graphql/private/resolverTypes' +import TemplateScale from '../../database/types/TemplateScale' +import {DataLoaderWorker} from '../../graphql/graphql' +import {ModifyType} from '../../graphql/public/resolverTypes' import {IntegrationProviderServiceEnumType} from '../../graphql/types/IntegrationProviderServiceEnum' import {UpgradeCTALocationEnumType} from '../../graphql/types/UpgradeCTALocationEnum' import {TeamPromptResponse} from '../../postgres/queries/getTeamPromptResponsesByIds' @@ -16,10 +19,6 @@ import {MeetingTypeEnum} from '../../postgres/types/Meeting' import {MeetingSeries} from '../../postgres/types/MeetingSeries' import {AmplitudeAnalytics} from './amplitude/AmplitudeAnalytics' import {createMeetingProperties} from './helpers' -import {SlackNotificationEventEnum} from '../../database/types/SlackNotification' -import TemplateScale from '../../database/types/TemplateScale' -import {DataLoaderWorker} from '../../graphql/graphql' -import {ModifyType} from '../../graphql/public/resolverTypes' export type AnalyticsUser = { id: string diff --git a/packages/server/utils/getGitHubRequest.ts b/packages/server/utils/getGitHubRequest.ts index 76efb0db5ae..59ff1eea559 100644 --- a/packages/server/utils/getGitHubRequest.ts +++ b/packages/server/utils/getGitHubRequest.ts @@ -1,6 +1,6 @@ import {GraphQLResolveInfo} from 'graphql' import {EndpointContext} from 'nest-graphql-endpoint/lib/types' -import {RootSchema} from '../graphql/public/rootSchema' +import {RootSchema} from '../types/custom' // This helper just cleans up the input/output boilerplate. // It breaks githubRequest into 2 parts so the info, endpointContext, and batchRef are kept in context From db63109d45d91e6b942980f3832d25bb9e32ffcb Mon Sep 17 00:00:00 2001 From: Matt Krick Date: Mon, 1 Apr 2024 10:48:57 -0700 Subject: [PATCH 2/2] fix: global noEmit Signed-off-by: Matt Krick --- packages/embedder/tsconfig.json | 1 - tsconfig.base.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/embedder/tsconfig.json b/packages/embedder/tsconfig.json index 4789de56e28..b75106d1a8a 100644 --- a/packages/embedder/tsconfig.json +++ b/packages/embedder/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "noEmit": true, "baseUrl": "../", "paths": { "parabol-server/*": ["server/*"], diff --git a/tsconfig.base.json b/tsconfig.base.json index adc1623c1b5..c207d6f1c07 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -16,6 +16,7 @@ "strictPropertyInitialization": true, "noImplicitThis": true, "alwaysStrict": true, + "noEmit": true, "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true,