Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/auth/src/schema.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/admin-ui/utils/utils.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/artifacts.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fields/types/bytes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fields/types/password/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/fields/types/virtual/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getNamedType, isLeafType } from 'graphql'
import { getNamedType, isLeafType } from 'graphql/index.js'
import {
type BaseItem,
type BaseListTypeInfo,
Expand Down
9 changes: 7 additions & 2 deletions packages/core/src/lib/coerceAndValidateForGraphQLInput.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/context/api.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/context/createContext.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/context/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
type TypeNode,
validate,
type VariableDefinitionNode,
} from 'graphql'
} from 'graphql/index.js'

import type { KeystoneContext } from '../../types'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/core/access-control.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertInputObjectType } from 'graphql'
import { assertInputObjectType } from 'graphql/index.js'

import { allowAll } from '../../access'
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/core/graphql-errors.ts
Original file line number Diff line number Diff line change
@@ -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' } })
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/core/initialise-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
GraphQLString,
isInputObjectType,
type GraphQLType,
} from 'graphql'
} from 'graphql/index.js'

import { g } from '../..'
import { expandVoidHooks } from '../../fields/resolve-hooks'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/core/mutations/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/core/queries/output-field.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/core/queries/resolvers.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/graphql.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/typescript-schema-printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/context.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/core.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/schema/scalars.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion packages/fields-document/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-document/src/structure-graphql-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion tests/admin-ui-tests/live-reloading.test.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion tests/api-tests/queries/orderBy.test.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
8 changes: 7 additions & 1 deletion tests/api-tests/queries/validation.ts
Original file line number Diff line number Diff line change
@@ -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 }

Expand Down
Loading