chore(server): get rid of duplicate gql TS types (#5065)
This commit is contained in:
committed by
GitHub
parent
2bbfb8cede
commit
b29331705e
+13
-28
@@ -6,7 +6,19 @@ const config: CodegenConfig = {
|
||||
documents: undefined,
|
||||
generates: {
|
||||
'modules/core/graph/generated/graphql.ts': {
|
||||
plugins: ['typescript', 'typescript-resolvers'],
|
||||
documents: [
|
||||
'modules/cross-server-sync/**/*.{js,ts}',
|
||||
'test/graphql/*.{js,ts}',
|
||||
'modules/**/tests/helpers/graphql.ts',
|
||||
'modules/**/tests/helpers/*Graphql.ts',
|
||||
'modules/**/tests/helpers/graphql/*.ts'
|
||||
],
|
||||
plugins: [
|
||||
'typescript',
|
||||
'typescript-resolvers',
|
||||
'typescript-operations',
|
||||
'typed-document-node'
|
||||
],
|
||||
config: {
|
||||
enumsAsConst: true,
|
||||
contextType: '@/modules/shared/helpers/typeHelper#GraphQLContext',
|
||||
@@ -173,33 +185,6 @@ const config: CodegenConfig = {
|
||||
'@/modules/workspacesCore/helpers/graphTypes#WorkspacePermissionChecksGraphQLReturn'
|
||||
}
|
||||
}
|
||||
},
|
||||
'modules/cross-server-sync/graph/generated/graphql.ts': {
|
||||
plugins: ['typescript', 'typescript-operations'],
|
||||
documents: ['modules/cross-server-sync/**/*.{js,ts}'],
|
||||
config: {
|
||||
enumsAsConst: true,
|
||||
scalars: {
|
||||
JSONObject: 'Record<string, unknown>',
|
||||
DateTime: 'string'
|
||||
}
|
||||
}
|
||||
},
|
||||
'test/graphql/generated/graphql.ts': {
|
||||
plugins: ['typescript', 'typescript-operations', 'typed-document-node'],
|
||||
documents: [
|
||||
'test/graphql/*.{js,ts}',
|
||||
'modules/**/tests/helpers/graphql.ts',
|
||||
'modules/**/tests/helpers/*Graphql.ts',
|
||||
'modules/**/tests/helpers/graphql/*.ts'
|
||||
],
|
||||
config: {
|
||||
enumsAsConst: true,
|
||||
scalars: {
|
||||
JSONObject: 'Record<string, unknown>',
|
||||
DateTime: 'string'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
config: {
|
||||
|
||||
@@ -48,7 +48,7 @@ import {
|
||||
GetPendingProjectAccessRequestsDocument,
|
||||
StreamRole,
|
||||
UseProjectAccessRequestDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { truncateTables } from '@/test/hooks'
|
||||
import {
|
||||
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
getStreamAccessRequest,
|
||||
useStreamAccessRequest
|
||||
} from '@/test/graphql/accessRequests'
|
||||
import { StreamRole } from '@/test/graphql/generated/graphql'
|
||||
import { StreamRole } from '@/modules/core/graph/generated/graphql'
|
||||
import { createAuthedTestContext, ServerAndContext } from '@/test/graphqlHelper'
|
||||
import { truncateTables } from '@/test/hooks'
|
||||
import {
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
CreateServerInviteDocument,
|
||||
CreateServerInviteMutationVariables,
|
||||
UseStreamInviteDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
createTestContext,
|
||||
testApolloServer,
|
||||
|
||||
@@ -21,7 +21,7 @@ import { BasicTestUser, createTestUsers } from '@/test/authHelper'
|
||||
import {
|
||||
AutomateValidateAuthCodeDocument,
|
||||
GetProjectAutomationDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
TestApolloServer,
|
||||
createTestContext,
|
||||
|
||||
@@ -144,7 +144,7 @@ import {
|
||||
import { authorizeResolver } from '@/modules/shared'
|
||||
import { createEmailListener, TestEmailListener } from '@/test/speckle-helpers/email'
|
||||
import { buildTestProject } from '@/modules/core/tests/helpers/creation'
|
||||
import { GetCommentsQueryVariables } from '@/test/graphql/generated/graphql'
|
||||
import { GetCommentsQueryVariables } from '@/modules/core/graph/generated/graphql'
|
||||
|
||||
const getServerInfo = getServerInfoFactory({ db })
|
||||
const getUser = getUserFactory({ db })
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
CreateProjectCommentReplyDocument,
|
||||
EditCommentInput,
|
||||
EditProjectCommentDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
ExecuteOperationOptions,
|
||||
testApolloServer,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@ import {
|
||||
ReadStreamsDocument,
|
||||
RevokeTokenDocument,
|
||||
TokenAppInfoDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
TestApolloServer,
|
||||
createTestContext,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
GetActiveUserDocument,
|
||||
GetProjectDocument,
|
||||
GetWorkspaceDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
createTestContext,
|
||||
testApolloServer,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { testApolloServer } from '@/test/graphqlHelper'
|
||||
import {
|
||||
CreateWorkspaceDocument,
|
||||
CreateWorkspaceProjectDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { validateAndCreateUserEmailFactory } from '@/modules/core/services/userEmails'
|
||||
import { finalizeInvitedServerRegistrationFactory } from '@/modules/serverinvites/services/processing'
|
||||
import {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
LimitedPersonalProjectCommentFragment,
|
||||
LimitedPersonalProjectVersionFragment,
|
||||
LimitedPersonalStreamCommitFragment
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import { createTestComment } from '@/test/speckle-helpers/commentHelper'
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
CreateObjectDocument,
|
||||
CreateWorkspaceDocument,
|
||||
CreateWorkspaceProjectDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { validateAndCreateUserEmailFactory } from '@/modules/core/services/userEmails'
|
||||
import { finalizeInvitedServerRegistrationFactory } from '@/modules/serverinvites/services/processing'
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { BasicTestUser, createTestUser } from '@/test/authHelper'
|
||||
import {
|
||||
CreateProjectDocument,
|
||||
ProjectVisibility
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { Roles } from '@/modules/core/helpers/mainConstants'
|
||||
import { expect } from 'chai'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
|
||||
@@ -73,7 +73,7 @@ import {
|
||||
ProjectUpdatedMessageType,
|
||||
ProjectVersionsUpdatedMessageType,
|
||||
UserProjectsUpdatedMessageType
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
TestApolloSubscriptionClient,
|
||||
testApolloSubscriptionServer,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
DeleteUserEmailDocument,
|
||||
SetPrimaryUserEmailDocument,
|
||||
VerifyUserEmailDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { EmailVerifications, UserEmails, Users } from '@/modules/core/dbSchema'
|
||||
import { validateAndCreateUserEmailFactory } from '@/modules/core/services/userEmails'
|
||||
import { finalizeInvitedServerRegistrationFactory } from '@/modules/serverinvites/services/processing'
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
SetLegacyProjectsExplainerCollapsedDocument,
|
||||
SetNewWorkspaceExplainerDismissedDocument,
|
||||
SetSpeckleConBannerDismissedDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import { expect } from 'chai'
|
||||
|
||||
@@ -9,7 +9,7 @@ import { BasicTestUser, createTestUser, createTestUsers } from '@/test/authHelpe
|
||||
import {
|
||||
UsersRetrievalDocument,
|
||||
UsersRetrievalInput
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
ExecuteOperationOptions,
|
||||
testApolloServer,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
GetProjectVersionsDocument,
|
||||
GetProjectWithModelVersionsDocument,
|
||||
GetProjectWithVersionsDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { validateAndCreateUserEmailFactory } from '@/modules/core/services/userEmails'
|
||||
import { finalizeInvitedServerRegistrationFactory } from '@/modules/serverinvites/services/processing'
|
||||
import {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
CreateModelInput,
|
||||
CreateProjectModelDocument,
|
||||
FindProjectModelByNameDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import { BasicTestStream, createTestStreams } from '@/test/speckle-helpers/streamHelper'
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
GetProjectObjectDocument,
|
||||
ProjectCreateInput,
|
||||
ProjectVisibility
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { createTestObject } from '@/test/speckle-helpers/commitHelper'
|
||||
import { times } from 'lodash-es'
|
||||
import { Roles } from '@speckle/shared'
|
||||
|
||||
@@ -34,7 +34,7 @@ import dayjs, { Dayjs } from 'dayjs'
|
||||
import {
|
||||
GetLimitedUserStreamsQuery,
|
||||
GetUserStreamsQuery
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { Get } from 'type-fest'
|
||||
import {
|
||||
createAuthedTestContext,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
ServerAndContext,
|
||||
testApolloServer
|
||||
} from '@/test/graphqlHelper'
|
||||
import { GetActiveUserEmailsDocument } from '@/test/graphql/generated/graphql'
|
||||
import { GetActiveUserEmailsDocument } from '@/modules/core/graph/generated/graphql'
|
||||
import { validateAndCreateUserEmailFactory } from '@/modules/core/services/userEmails'
|
||||
import { finalizeInvitedServerRegistrationFactory } from '@/modules/serverinvites/services/processing'
|
||||
import {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
CreateVersionInput,
|
||||
MarkProjectVersionReceivedDocument,
|
||||
MarkReceivedVersionInput
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import { getStreamActivities } from '@/test/speckle-helpers/activityStreamHelper'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
||||
import fetch from 'cross-fetch'
|
||||
import { ApolloClient, NormalizedCacheObject, gql } from '@apollo/client/core'
|
||||
import { getFrontendOrigin } from '@/modules/shared/helpers/envHelper'
|
||||
import { CreateCommentInput } from '@/test/graphql/generated/graphql'
|
||||
import { Roles, TIME_MS, timeoutAt } from '@speckle/shared'
|
||||
import ObjectLoader from '@speckle/objectloader'
|
||||
import { noop } from 'lodash-es'
|
||||
@@ -18,8 +17,9 @@ import {
|
||||
CrossSyncCommitBranchMetadataQuery,
|
||||
CrossSyncCommitDownloadMetadataQuery,
|
||||
CrossSyncDownloadableCommitViewerThreadsQuery,
|
||||
CrossSyncProjectViewerResourcesQuery
|
||||
} from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
CrossSyncProjectViewerResourcesQuery,
|
||||
CreateCommentInput
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { DownloadCommit } from '@/modules/cross-server-sync/domain/operations'
|
||||
import {
|
||||
CreateCommentReplyAndNotify,
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
gql,
|
||||
assertValidGraphQLResult
|
||||
} from '@/modules/cross-server-sync/utils/graphqlClient'
|
||||
import { CrossSyncProjectMetadataQuery } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { CrossSyncProjectMetadataQuery } from '@/modules/core/graph/generated/graphql'
|
||||
import { omit } from 'lodash-es'
|
||||
import { getFrontendOrigin } from '@/modules/shared/helpers/envHelper'
|
||||
import {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '@apollo/client/core'
|
||||
import { setContext } from '@apollo/client/link/context/context.cjs'
|
||||
import { getServerVersion } from '@/modules/shared/helpers/envHelper'
|
||||
import { CrossSyncClientTestQuery } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { CrossSyncClientTestQuery } from '@/modules/core/graph/generated/graphql'
|
||||
import { EnvironmentResourceError } from '@/modules/shared/errors'
|
||||
|
||||
export type GraphQLClient = ApolloClient<NormalizedCacheObject>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CreateAndStoreAppToken } from '@/modules/core/domain/tokens/operations'
|
||||
import { DefaultAppIds } from '@/modules/auth/defaultApps'
|
||||
import { Scopes, TIME, TIME_MS } from '@speckle/shared'
|
||||
import { TokenResourceIdentifierType } from '@/test/graphql/generated/graphql'
|
||||
import { TokenResourceIdentifierType } from '@/modules/core/graph/generated/graphql'
|
||||
import { PushJobToFileImporter } from '@/modules/fileuploads/domain/operations'
|
||||
import { getFileImportTimeLimitMinutes } from '@/modules/shared/helpers/envHelper'
|
||||
import {
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
CreateCheckoutSession,
|
||||
WorkspaceSeatType
|
||||
} from '@/modules/gatekeeper/domain/billing'
|
||||
import { WorkspacePaymentMethod } from '@/test/graphql/generated/graphql'
|
||||
import { WorkspacePaymentMethod } from '@/modules/core/graph/generated/graphql'
|
||||
import { LogicError, UnauthorizedError } from '@/modules/shared/errors'
|
||||
import { getWorkspacePlanProductPricesFactory } from '@/modules/gatekeeper/services/prices'
|
||||
import { extendLoggerComponent } from '@/observability/logging'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getFeatureFlags } from '@/modules/shared/helpers/envHelper'
|
||||
import { GetWorkspacePlanPricesDocument } from '@/test/graphql/generated/graphql'
|
||||
import { GetWorkspacePlanPricesDocument } from '@/modules/core/graph/generated/graphql'
|
||||
import { TestApolloServer, testApolloServer } from '@/test/graphqlHelper'
|
||||
import { PaidWorkspacePlans } from '@speckle/shared'
|
||||
import { expect } from 'chai'
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
GetWorkspaceDocument,
|
||||
GetWorkspacePlanUsageDocument,
|
||||
GetWorkspaceWithSubscriptionDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
createTestContext,
|
||||
testApolloServer,
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
buildTestWorkspacePlan,
|
||||
buildTestWorkspaceSubscription
|
||||
} from '@/modules/gatekeeper/tests/helpers/workspacePlan'
|
||||
import { WorkspacePlanStatuses } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { WorkspacePlanStatuses } from '@/modules/core/graph/generated/graphql'
|
||||
|
||||
describe('workspacePlan services @gatekeeper', () => {
|
||||
describe('updateWorkspacePlanFactory creates a function, that', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { BillingInterval } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { BillingInterval } from '@/modules/core/graph/generated/graphql'
|
||||
import { WorkspacePlan } from '@speckle/shared'
|
||||
|
||||
export const gatekeeperEventNamespace = 'gatekeeper' as const
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
GetRegionalProjectCommentDocument,
|
||||
GetRegionalProjectWebhookDocument,
|
||||
GetRegionalProjectBlobDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { TestApolloServer, testApolloServer } from '@/test/graphqlHelper'
|
||||
import {
|
||||
createTestAutomation,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
GetRegionsDocument,
|
||||
UpdateRegionDocument,
|
||||
UpdateServerRegionInput
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
ExecuteOperationOptions,
|
||||
testApolloServer,
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
ServerInviteCreateInput,
|
||||
StreamInviteCreateInput,
|
||||
UseStreamInviteDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { ServerInviteRecord } from '@/modules/serverinvites/domain/types'
|
||||
import { reduce } from 'lodash-es'
|
||||
import { grantStreamPermissionsFactory } from '@/modules/core/repositories/streams'
|
||||
|
||||
@@ -9,7 +9,7 @@ import Mixpanel from 'mixpanel'
|
||||
import type express from 'express'
|
||||
import type http from 'http'
|
||||
import { mixpanelLogger } from '@/observability/logging'
|
||||
import { WorkspacePlanStatuses } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { WorkspacePlanStatuses } from '@/modules/core/graph/generated/graphql'
|
||||
|
||||
let client: Optional<MixpanelClient> = undefined
|
||||
let baseTrackingProperties: Optional<Record<string, string>> = undefined
|
||||
|
||||
@@ -140,7 +140,7 @@ import { getWorkspaceModelCountFactory } from '@/modules/workspaces/services/wor
|
||||
import { getPaginatedProjectModelsTotalCountFactory } from '@/modules/core/repositories/branches'
|
||||
import { buildWorkspaceTrackingPropertiesFactory } from '@/modules/workspaces/services/tracking'
|
||||
import { assign } from 'lodash-es'
|
||||
import { WorkspacePlanStatuses } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { WorkspacePlanStatuses } from '@/modules/core/graph/generated/graphql'
|
||||
import { GatekeeperEvents } from '@/modules/gatekeeperCore/domain/events'
|
||||
import { GetUser } from '@/modules/core/domain/users/operations'
|
||||
import { WorkspacePlans } from '@/modules/core/graph/generated/graphql'
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
UpdateStreamRole
|
||||
} from '@/modules/core/domain/streams/operations'
|
||||
import { ProjectNotFoundError } from '@/modules/core/errors/projects'
|
||||
import { WorkspaceProjectCreateInput } from '@/test/graphql/generated/graphql'
|
||||
import { WorkspaceProjectCreateInput } from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
getDb,
|
||||
getValidDefaultProjectRegionKey
|
||||
|
||||
@@ -46,7 +46,7 @@ import {
|
||||
generateValidSlugFactory
|
||||
} from '@/modules/workspaces/services/management'
|
||||
import { BasicTestUser } from '@/test/authHelper'
|
||||
import { CreateWorkspaceInviteMutationVariables } from '@/test/graphql/generated/graphql'
|
||||
import { CreateWorkspaceInviteMutationVariables } from '@/modules/core/graph/generated/graphql'
|
||||
import cryptoRandomString from 'crypto-random-string'
|
||||
import {
|
||||
MaybeNullOrUndefined,
|
||||
@@ -135,7 +135,7 @@ import {
|
||||
WorkspaceSeat,
|
||||
WorkspaceWithOptionalRole
|
||||
} from '@/modules/workspacesCore/domain/types'
|
||||
import { WorkspaceRole } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { WorkspaceRole } from '@/modules/core/graph/generated/graphql'
|
||||
|
||||
const { FF_WORKSPACES_MODULE_ENABLED } = getFeatureFlags()
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
UseWorkspaceInviteMutationVariables,
|
||||
UseWorkspaceProjectInviteDocument,
|
||||
UseWorkspaceProjectInviteMutationVariables
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { expect } from 'chai'
|
||||
|
||||
import { MaybeAsync, StreamRoles, WorkspaceRoles } from '@speckle/shared'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { basicWorkspaceFragment } from '@/modules/workspaces/tests/helpers/graphql'
|
||||
import { ProjectImplicitRoleCheckFragment } from '@/test/graphql/generated/graphql'
|
||||
import { ProjectImplicitRoleCheckFragment } from '@/modules/core/graph/generated/graphql'
|
||||
import { MaybeNullOrUndefined, Roles } from '@speckle/shared'
|
||||
import { gql } from 'graphql-tag'
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
TestApolloServer
|
||||
} from '@/test/graphqlHelper'
|
||||
import { beforeEachContext, truncateTables } from '@/test/hooks'
|
||||
import { WorkspaceRole } from '@/test/graphql/generated/graphql'
|
||||
import { WorkspaceRole } from '@/modules/core/graph/generated/graphql'
|
||||
import { expect } from 'chai'
|
||||
import {
|
||||
captureCreatedInvite,
|
||||
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
UpdateProjectDocument,
|
||||
UpdateProjectRoleDocument,
|
||||
UpdateWorkspaceProjectRoleDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
ExecuteOperationResponse,
|
||||
testApolloServer,
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
GetAvailableRegionsDocument,
|
||||
GetWorkspaceDefaultRegionDocument,
|
||||
SetWorkspaceDefaultRegionDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext, getRegionKeys } from '@/test/hooks'
|
||||
import { truncateRegionsSafely } from '@/test/speckle-helpers/regions'
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
GetWorkspaceDocument,
|
||||
UpdateWorkspaceRoleDocument,
|
||||
UpdateWorkspaceSeatTypeDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
createTestContext,
|
||||
testApolloServer,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
GetWorkspaceDocument,
|
||||
GetWorkspaceProjectsDocument,
|
||||
GetWorkspaceSsoDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
createTestContext,
|
||||
testApolloServer,
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
OnWorkspaceProjectsUpdatedDocument,
|
||||
OnWorkspaceUpdatedDocument,
|
||||
WorkspaceProjectsUpdatedMessageType
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import {
|
||||
testApolloServer,
|
||||
TestApolloServer,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
GetProjectInvitableCollaboratorsDocument,
|
||||
SetUserActiveWorkspaceDocument,
|
||||
UserActiveResourcesDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import { BasicTestStream, createTestStream } from '@/test/speckle-helpers/streamHelper'
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import {
|
||||
GetActiveUserWithWorkspaceJoinRequestsDocument,
|
||||
GetWorkspaceWithJoinRequestsDocument,
|
||||
RequestToJoinWorkspaceDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import { Roles } from '@speckle/shared'
|
||||
import { expect } from 'chai'
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
GetProjectCollaboratorsDocument,
|
||||
UpdateWorkspaceSeatTypeDocument,
|
||||
WorkspaceUpdateSeatTypeInput
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { testApolloServer, TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { beforeEachContext } from '@/test/hooks'
|
||||
import {
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
UpdateEmbedOptionsDocument,
|
||||
WorkspaceEmbedOptionsDocument,
|
||||
ProjectEmbedOptionsDocument
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { beforeEachContext, truncateTables } from '@/test/hooks'
|
||||
import { AllScopes } from '@/modules/core/helpers/mainConstants'
|
||||
import {
|
||||
|
||||
@@ -37,7 +37,7 @@ import { WorkspacePlans, WorkspacePlanStatuses } from '@speckle/shared'
|
||||
import { WorkspaceEvents } from '@/modules/workspacesCore/domain/events'
|
||||
import { GetUser } from '@/modules/core/domain/users/operations'
|
||||
import cryptoRandomString from 'crypto-random-string'
|
||||
import { BillingInterval } from '@/modules/cross-server-sync/graph/generated/graphql'
|
||||
import { BillingInterval } from '@/modules/core/graph/generated/graphql'
|
||||
|
||||
const { FF_BILLING_INTEGRATION_ENABLED } = getFeatureFlags()
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
WorkspaceDomain
|
||||
} from '@/modules/workspacesCore/domain/types'
|
||||
import { expectToThrow } from '@/test/assertionHelper'
|
||||
import { ProjectUpdateRoleInput } from '@/test/graphql/generated/graphql'
|
||||
import { ProjectUpdateRoleInput } from '@/modules/core/graph/generated/graphql'
|
||||
import { Roles, StreamRoles, WorkspaceRoles } from '@speckle/shared'
|
||||
import { expect } from 'chai'
|
||||
import cryptoRandomString from 'crypto-random-string'
|
||||
|
||||
@@ -101,7 +101,7 @@ It's suggested to just run tests from the VSCode test explorer, however.
|
||||
|
||||
The best way to do integration tests is to actually invoke queries against an `ApolloServer` instance. To make this process even better you can rely on GraphQL Code Generator to properly generate types for the queries you write in your tests.
|
||||
|
||||
Put your test-specific queries/mutations in `@/test/graphql` and then run `yarn gqlgen`. This will generate a typings file at `@/test/graphql/generated/graphql.ts` which will contain query & variable types for the operations you've created.
|
||||
Put your test-specific queries/mutations in `@/test/graphql` and then run `yarn gqlgen`. This will generate typings which will contain query & variable types for the operations you've created.
|
||||
|
||||
You can then specify these types when running operations through `executeOperation` from `@/test/graphqlHelper.ts` (through the generic arguments), and then inside your TS test file you'll get properly typed response structures. Awesome!
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
GetStreamAccessRequestQueryVariables,
|
||||
UseStreamAccessRequestMutation,
|
||||
UseStreamAccessRequestMutationVariables
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { executeOperation, ExecuteOperationServer } from '@/test/graphqlHelper'
|
||||
import { gql } from 'graphql-tag'
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
GetCommentQueryVariables,
|
||||
GetCommentsQuery,
|
||||
GetCommentsQueryVariables
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { executeOperation, ExecuteOperationServer } from '@/test/graphqlHelper'
|
||||
import { gql } from 'graphql-tag'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
ReadOwnCommitsQueryVariables,
|
||||
ReadStreamBranchCommitsQuery,
|
||||
ReadStreamBranchCommitsQueryVariables
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { executeOperation, ExecuteOperationServer } from '@/test/graphqlHelper'
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ import {
|
||||
GetUserStreamsQuery,
|
||||
GetLimitedUserStreamsQuery,
|
||||
GetLimitedUserStreamsQueryVariables
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { executeOperation, ExecuteOperationServer } from '@/test/graphqlHelper'
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
GetPendingEmailVerificationStatusQueryVariables,
|
||||
RequestVerificationMutation,
|
||||
RequestVerificationMutationVariables
|
||||
} from '@/test/graphql/generated/graphql'
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import { executeOperation, ExecuteOperationServer } from '@/test/graphqlHelper'
|
||||
import gql from 'graphql-tag'
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import { createAuthTokenForUser } from '@/test/authHelper'
|
||||
import { SubscriptionClient } from 'subscriptions-transport-ws'
|
||||
import { WebSocketLink } from '@apollo/client/link/ws/ws.cjs'
|
||||
import { execute } from '@apollo/client/core'
|
||||
import { PingPongDocument } from '@/test/graphql/generated/graphql'
|
||||
import { PingPongDocument } from '@/modules/core/graph/generated/graphql'
|
||||
import { BaseError } from '@/modules/shared/errors'
|
||||
import EventEmitter from 'eventemitter2'
|
||||
import { expectToThrow } from '@/test/assertionHelper'
|
||||
|
||||
@@ -59,7 +59,7 @@ import { getEventBus } from '@/modules/shared/services/eventBus'
|
||||
import { getDefaultRegionFactory } from '@/modules/workspaces/repositories/regions'
|
||||
import { createWorkspaceProjectFactory } from '@/modules/workspaces/services/projects'
|
||||
import { BasicTestUser } from '@/test/authHelper'
|
||||
import { ProjectVisibility } from '@/test/graphql/generated/graphql'
|
||||
import { ProjectVisibility } from '@/modules/core/graph/generated/graphql'
|
||||
import { faker } from '@faker-js/faker'
|
||||
import { ensureError, Roles, StreamRoles } from '@speckle/shared'
|
||||
import { omit } from 'lodash-es'
|
||||
|
||||
Reference in New Issue
Block a user