diff --git a/packages/auth/src/schema.ts b/packages/auth/src/schema.ts index fdbeee17f2a..fc026052e16 100644 --- a/packages/auth/src/schema.ts +++ b/packages/auth/src/schema.ts @@ -1,4 +1,4 @@ -import { assertInputObjectType, GraphQLString, GraphQLID, parse, validate } from 'graphql' +import { assertInputObjectType, GraphQLString, GraphQLID, parse, validate } from 'graphql/index.js' import { g } from '@keystone-6/core' import type { AuthGqlNames, AuthTokenTypeConfig } from './types' diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx index a7e90395cd6..ed2ffb28d39 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx @@ -1,5 +1,5 @@ import isDeepEqual from 'fast-deep-equal' -import type { GraphQLFormattedError } from 'graphql' +import type { GraphQLFormattedError } from 'graphql/index.js' import { useRouter } from '../../../../admin-ui/router' import type { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring' import { type FormEvent, type Key, Fragment, useEffect, useId, useMemo, useState } from 'react' diff --git a/packages/core/src/admin-ui/components/GraphQLErrorNotice.tsx b/packages/core/src/admin-ui/components/GraphQLErrorNotice.tsx index c2e4c9bb00a..0df2ce249da 100644 --- a/packages/core/src/admin-ui/components/GraphQLErrorNotice.tsx +++ b/packages/core/src/admin-ui/components/GraphQLErrorNotice.tsx @@ -4,7 +4,7 @@ import { type ServerError, type ServerParseError, } from '@apollo/client' -import type { GraphQLError, GraphQLFormattedError } from 'graphql' +import type { GraphQLError, GraphQLFormattedError } from 'graphql/index.js' import { VStack } from '@keystar/ui/layout' import { Notice } from '@keystar/ui/notice' diff --git a/packages/core/src/admin-ui/utils/utils.tsx b/packages/core/src/admin-ui/utils/utils.tsx index 9a35405e0c8..e9cbfd59b3e 100644 --- a/packages/core/src/admin-ui/utils/utils.tsx +++ b/packages/core/src/admin-ui/utils/utils.tsx @@ -1,5 +1,5 @@ import isDeepEqual from 'fast-deep-equal' -import { type FragmentDefinitionNode, type SelectionSetNode, parse } from 'graphql' +import { type FragmentDefinitionNode, type SelectionSetNode, parse } from 'graphql/index.js' import { useMemo } from 'react' import type { diff --git a/packages/core/src/artifacts.ts b/packages/core/src/artifacts.ts index 1a135b0b142..22d522d6e25 100644 --- a/packages/core/src/artifacts.ts +++ b/packages/core/src/artifacts.ts @@ -1,7 +1,7 @@ import fs from 'node:fs/promises' import path from 'node:path' -import { printSchema } from 'graphql' +import { printSchema } from 'graphql/index.js' import { printPrismaSchema } from './lib/core/prisma-schema-printer' import { withSpan } from './lib/otel' import type { System } from './lib/system' diff --git a/packages/core/src/fields/types/bytes/index.ts b/packages/core/src/fields/types/bytes/index.ts index 71475f4576e..d014db49653 100644 --- a/packages/core/src/fields/types/bytes/index.ts +++ b/packages/core/src/fields/types/bytes/index.ts @@ -8,7 +8,7 @@ import { import { g } from '../../..' import { makeValidateHook, defaultIsRequired } from '../../non-null-graphql' import { weakMemoize } from '../../../lib/core/utils' -import { GraphQLError } from 'graphql' +import { GraphQLError } from 'graphql/index.js' import type { GArg, GInputObjectType, diff --git a/packages/core/src/fields/types/password/index.ts b/packages/core/src/fields/types/password/index.ts index 45ef693725d..1d57806c2fa 100644 --- a/packages/core/src/fields/types/password/index.ts +++ b/packages/core/src/fields/types/password/index.ts @@ -10,7 +10,7 @@ import { } from '../../../types' import { g } from '../../..' import { makeValidateHook, defaultIsRequired } from '../../non-null-graphql' -import { isObjectType, type GraphQLSchema } from 'graphql' +import { isObjectType, type GraphQLSchema } from 'graphql/index.js' import type { InferValueFromInputType } from '@graphql-ts/schema' import type { controller } from './views' diff --git a/packages/core/src/fields/types/virtual/index.ts b/packages/core/src/fields/types/virtual/index.ts index a07ba7be5be..a634a833dd8 100644 --- a/packages/core/src/fields/types/virtual/index.ts +++ b/packages/core/src/fields/types/virtual/index.ts @@ -1,4 +1,4 @@ -import { getNamedType, isLeafType } from 'graphql' +import { getNamedType, isLeafType } from 'graphql/index.js' import { type BaseItem, type BaseListTypeInfo, diff --git a/packages/core/src/lib/coerceAndValidateForGraphQLInput.ts b/packages/core/src/lib/coerceAndValidateForGraphQLInput.ts index 875bbe2d3ab..dd0ddb571e8 100644 --- a/packages/core/src/lib/coerceAndValidateForGraphQLInput.ts +++ b/packages/core/src/lib/coerceAndValidateForGraphQLInput.ts @@ -1,5 +1,10 @@ -import type { GraphQLError, GraphQLInputType, GraphQLSchema, VariableDefinitionNode } from 'graphql' -import { Kind } from 'graphql' +import type { + GraphQLError, + GraphQLInputType, + GraphQLSchema, + VariableDefinitionNode, +} from 'graphql/index.js' +import { Kind } from 'graphql/index.js' import { getVariableValues } from 'graphql/execution/values.js' import { getTypeNodeForType } from './context/graphql' diff --git a/packages/core/src/lib/context/api.ts b/packages/core/src/lib/context/api.ts index 4a01dd3b025..746a0e6842a 100644 --- a/packages/core/src/lib/context/api.ts +++ b/packages/core/src/lib/context/api.ts @@ -1,4 +1,4 @@ -import type { GraphQLSchema } from 'graphql' +import type { GraphQLSchema } from 'graphql/index.js' import type { KeystoneContext } from '../../types' import type { InitialisedList } from '../core/initialise-lists' import { makeContextDbFn, makeContextQueryFn } from './graphql' diff --git a/packages/core/src/lib/context/createContext.ts b/packages/core/src/lib/context/createContext.ts index b804d1416e0..116b38aa36a 100644 --- a/packages/core/src/lib/context/createContext.ts +++ b/packages/core/src/lib/context/createContext.ts @@ -1,5 +1,5 @@ import type { IncomingMessage, ServerResponse } from 'http' -import { type ExecutionResult, type GraphQLSchema, graphql, print } from 'graphql' +import { type ExecutionResult, type GraphQLSchema, graphql, print } from 'graphql/index.js' import type { KeystoneContext, KeystoneGraphQLAPI, KeystoneConfig } from '../../types' import type { InitialisedList } from '../core/initialise-lists' diff --git a/packages/core/src/lib/context/graphql.ts b/packages/core/src/lib/context/graphql.ts index be8dda78e59..702366c0ad5 100644 --- a/packages/core/src/lib/context/graphql.ts +++ b/packages/core/src/lib/context/graphql.ts @@ -28,7 +28,7 @@ import { type TypeNode, validate, type VariableDefinitionNode, -} from 'graphql' +} from 'graphql/index.js' import type { KeystoneContext } from '../../types' diff --git a/packages/core/src/lib/core/access-control.ts b/packages/core/src/lib/core/access-control.ts index 743b8ce6795..13b5a62a5fb 100644 --- a/packages/core/src/lib/core/access-control.ts +++ b/packages/core/src/lib/core/access-control.ts @@ -1,4 +1,4 @@ -import { assertInputObjectType } from 'graphql' +import { assertInputObjectType } from 'graphql/index.js' import { allowAll } from '../../access' import type { diff --git a/packages/core/src/lib/core/graphql-errors.ts b/packages/core/src/lib/core/graphql-errors.ts index 3c72a6c45f4..42e20ee380a 100644 --- a/packages/core/src/lib/core/graphql-errors.ts +++ b/packages/core/src/lib/core/graphql-errors.ts @@ -1,4 +1,4 @@ -import { GraphQLError } from 'graphql' +import { GraphQLError } from 'graphql/index.js' export const userInputError = (msg: string) => new GraphQLError(`Input error: ${msg}`, { extensions: { code: 'KS_USER_INPUT_ERROR' } }) diff --git a/packages/core/src/lib/core/initialise-lists.ts b/packages/core/src/lib/core/initialise-lists.ts index 11568fffaae..05d0c4c588d 100644 --- a/packages/core/src/lib/core/initialise-lists.ts +++ b/packages/core/src/lib/core/initialise-lists.ts @@ -8,7 +8,7 @@ import { GraphQLString, isInputObjectType, type GraphQLType, -} from 'graphql' +} from 'graphql/index.js' import { g } from '../..' import { expandVoidHooks } from '../../fields/resolve-hooks' diff --git a/packages/core/src/lib/core/mutations/index.ts b/packages/core/src/lib/core/mutations/index.ts index 79ce4565517..2f4e01518db 100644 --- a/packages/core/src/lib/core/mutations/index.ts +++ b/packages/core/src/lib/core/mutations/index.ts @@ -1,5 +1,5 @@ import { GInputObjectType, type GNullableInputType } from '@graphql-ts/schema' -import type { GraphQLNamedType } from 'graphql' +import type { GraphQLNamedType } from 'graphql/index.js' import type { BaseItem, KeystoneContext } from '../../../types' import type { UniquePrismaFilter } from '../../../types/prisma' diff --git a/packages/core/src/lib/core/queries/output-field.ts b/packages/core/src/lib/core/queries/output-field.ts index cfd244b55f7..2413471368b 100644 --- a/packages/core/src/lib/core/queries/output-field.ts +++ b/packages/core/src/lib/core/queries/output-field.ts @@ -1,6 +1,6 @@ import { type CacheHint, maybeCacheControlFromInfo } from '@apollo/cache-control-types' import DataLoader from 'dataloader' -import type { GraphQLResolveInfo } from 'graphql' +import type { GraphQLResolveInfo } from 'graphql/index.js' import { g } from '../../..' import type { diff --git a/packages/core/src/lib/core/queries/resolvers.ts b/packages/core/src/lib/core/queries/resolvers.ts index cb8a30c7bae..ede60552e15 100644 --- a/packages/core/src/lib/core/queries/resolvers.ts +++ b/packages/core/src/lib/core/queries/resolvers.ts @@ -1,5 +1,5 @@ import { maybeCacheControlFromInfo } from '@apollo/cache-control-types' -import type { GraphQLResolveInfo } from 'graphql' +import type { GraphQLResolveInfo } from 'graphql/index.js' import type { BaseItem, FindManyArgsValue, KeystoneContext, OrderDirection } from '../../../types' import type { PrismaFilter, UniquePrismaFilter } from '../../../types/prisma' diff --git a/packages/core/src/lib/express.ts b/packages/core/src/lib/express.ts index e3b073b8746..b416579b20f 100644 --- a/packages/core/src/lib/express.ts +++ b/packages/core/src/lib/express.ts @@ -3,7 +3,7 @@ import cors from 'cors' import { json } from 'body-parser' import { expressMiddleware } from '@as-integrations/express5' import express from 'express' -import { GraphQLError, type GraphQLFormattedError } from 'graphql' +import { GraphQLError, type GraphQLFormattedError } from 'graphql/index.js' import { type ApolloServerOptions, ApolloServer } from '@apollo/server' import { ApolloServerPluginLandingPageDisabled } from '@apollo/server/plugin/disabled' import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default' diff --git a/packages/core/src/lib/graphql.ts b/packages/core/src/lib/graphql.ts index 0e311603ef5..699c5fd152f 100644 --- a/packages/core/src/lib/graphql.ts +++ b/packages/core/src/lib/graphql.ts @@ -1,5 +1,5 @@ import type { GField, GOutputType } from '@graphql-ts/schema' -import { type GraphQLNamedType, GraphQLSchema } from 'graphql' +import { type GraphQLNamedType, GraphQLSchema } from 'graphql/index.js' import type { KeystoneConfig, KeystoneContext } from '../types' import { g } from '../types/schema' diff --git a/packages/core/src/lib/typescript-schema-printer.ts b/packages/core/src/lib/typescript-schema-printer.ts index e692f34ebba..2c05d0df91e 100644 --- a/packages/core/src/lib/typescript-schema-printer.ts +++ b/packages/core/src/lib/typescript-schema-printer.ts @@ -8,7 +8,7 @@ import { GraphQLNonNull, GraphQLScalarType, introspectionTypes, -} from 'graphql' +} from 'graphql/index.js' import type { InitialisedList } from './core/initialise-lists' import type { DatabaseProvider } from '../types' diff --git a/packages/core/src/scripts/dev.ts b/packages/core/src/scripts/dev.ts index 418003bc423..672ca3cd80f 100644 --- a/packages/core/src/scripts/dev.ts +++ b/packages/core/src/scripts/dev.ts @@ -6,7 +6,7 @@ import path from 'node:path' import esbuild, { type BuildResult } from 'esbuild' import express from 'express' -import { printSchema } from 'graphql' +import { printSchema } from 'graphql/index.js' import next from 'next' import { generateAdminUI } from '../admin-ui/system' diff --git a/packages/core/src/types/config/index.ts b/packages/core/src/types/config/index.ts index f83f53645a7..44bf71cb3ba 100644 --- a/packages/core/src/types/config/index.ts +++ b/packages/core/src/types/config/index.ts @@ -5,7 +5,7 @@ import type { ApolloServerOptions } from '@apollo/server' import type { Options as BodyParserOptions } from 'body-parser' import type { CorsOptions } from 'cors' import type express from 'express' -import type { GraphQLSchema } from 'graphql' +import type { GraphQLSchema } from 'graphql/index.js' import type { BaseKeystoneTypeInfo, DatabaseProvider, KeystoneContext } from '..' import type { SessionStrategy } from '../session' diff --git a/packages/core/src/types/context.ts b/packages/core/src/types/context.ts index a6d9dfd6607..89271ac8e01 100644 --- a/packages/core/src/types/context.ts +++ b/packages/core/src/types/context.ts @@ -1,5 +1,5 @@ import type { IncomingMessage, ServerResponse } from 'http' -import type { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql' +import type { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql/index.js' import type { TypedDocumentNode } from '@graphql-typed-document-node/core' import type { InitialisedList } from '../lib/core/initialise-lists' import type { SessionStrategy } from './session' diff --git a/packages/core/src/types/core.ts b/packages/core/src/types/core.ts index 2efc370c639..6ec1d34c14e 100644 --- a/packages/core/src/types/core.ts +++ b/packages/core/src/types/core.ts @@ -1,4 +1,4 @@ -import type { GraphQLResolveInfo } from 'graphql' +import type { GraphQLResolveInfo } from 'graphql/index.js' import type { KeystoneContext } from './context' export type DatabaseProvider = 'sqlite' | 'postgresql' | 'mysql' diff --git a/packages/core/src/types/schema/scalars.ts b/packages/core/src/types/schema/scalars.ts index 790b514cbac..c1f3af984e5 100644 --- a/packages/core/src/types/schema/scalars.ts +++ b/packages/core/src/types/schema/scalars.ts @@ -1,7 +1,7 @@ import type { ReadStream } from 'node:fs' // @ts-expect-error import GraphQLUpload from 'graphql-upload/GraphQLUpload.js' -import { GraphQLError, GraphQLScalarType } from 'graphql' +import { GraphQLError, GraphQLScalarType } from 'graphql/index.js' import { Decimal as DecimalValue } from 'decimal.js' import type { JSONValue } from '../utils' diff --git a/packages/fields-document/src/index.ts b/packages/fields-document/src/index.ts index 90b0a6aa75c..71c88a197df 100644 --- a/packages/fields-document/src/index.ts +++ b/packages/fields-document/src/index.ts @@ -9,7 +9,7 @@ import { type ListSortDescriptor, fieldType, } from '@keystone-6/core/types' -import { GraphQLError } from 'graphql' +import { GraphQLError } from 'graphql/index.js' import type { ComponentBlock } from './DocumentEditor/component-blocks/api-shared' import { assertValidComponentSchema } from './DocumentEditor/component-blocks/field-assertions' import type { Relationships } from './DocumentEditor/relationship-shared' diff --git a/packages/fields-document/src/structure-graphql-input.ts b/packages/fields-document/src/structure-graphql-input.ts index 60c347d6be4..5e3719a5174 100644 --- a/packages/fields-document/src/structure-graphql-input.ts +++ b/packages/fields-document/src/structure-graphql-input.ts @@ -6,7 +6,7 @@ import type { GraphQLTypesForList, KeystoneContext, } from '@keystone-6/core/types' -import type { GraphQLResolveInfo } from 'graphql' +import type { GraphQLResolveInfo } from 'graphql/index.js' import type { ComponentSchema } from './DocumentEditor/component-blocks/api' import { getInitialPropsValue } from './DocumentEditor/component-blocks/initial-values' diff --git a/tests/admin-ui-tests/live-reloading.test.ts b/tests/admin-ui-tests/live-reloading.test.ts index 261f2ba06b1..bfbaf2f19f4 100644 --- a/tests/admin-ui-tests/live-reloading.test.ts +++ b/tests/admin-ui-tests/live-reloading.test.ts @@ -1,5 +1,5 @@ import { afterAll, expect, test, vi } from 'vitest' -import { parse, print } from 'graphql' +import { parse, print } from 'graphql/index.js' import { readFile, writeFile } from 'node:fs/promises' import path from 'node:path' diff --git a/tests/api-tests/queries/orderBy.test.ts b/tests/api-tests/queries/orderBy.test.ts index 14bd1a6b3fa..a9b60685dea 100644 --- a/tests/api-tests/queries/orderBy.test.ts +++ b/tests/api-tests/queries/orderBy.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import type { ExecutionResult } from 'graphql' +import type { ExecutionResult } from 'graphql/index.js' import { setupTestRunner } from '@keystone-6/api-tests/test-runner' import { list } from '@keystone-6/core' diff --git a/tests/api-tests/queries/validation.ts b/tests/api-tests/queries/validation.ts index 58115aa652d..8e5d26311b8 100644 --- a/tests/api-tests/queries/validation.ts +++ b/tests/api-tests/queries/validation.ts @@ -1,4 +1,10 @@ -import { visit, Kind, type ValidationContext, type ASTNode, type ASTVisitor } from 'graphql' +import { + visit, + Kind, + type ValidationContext, + type ASTNode, + type ASTVisitor, +} from 'graphql/index.js' type Fragment = { name: string; atDepth: number }