Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Not to bind core for connectionPlugin #1142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 src/plugins/connectionPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export const connectionPlugin = (connectionPluginConfig?: ConnectionPluginConfig
fieldDefTypes: [
printedGenTypingImport({
module: connectionPluginConfig?.nexusSchemaImportId ?? getOwnPackage().name,
bindings: ['core', 'connectionPluginCore'],
bindings: ['connectionPluginCore'],
}),
],
// Defines the field added to the definition block:
Expand Down
6 changes: 2 additions & 4 deletions src/typegenPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,8 @@ export class TypegenPrinter {
const imports: string[] = []
const importMap: Record<string, Set<string>> = {}
const outputPath = this.typegenInfo.typegenPath
const nexusSchemaImportId = this.typegenInfo.nexusSchemaImportId ?? getOwnPackage().name

if (!this.printImports[nexusSchemaImportId]) {
this.maybeAddCoreImport(forGlobal)
}
this.maybeAddCoreImport(forGlobal)

if (!forGlobal) {
if (contextTypeImport) {
Expand Down Expand Up @@ -320,6 +317,7 @@ export class TypegenPrinter {

if (shouldAdd) {
this.printImports[nexusSchemaImportId] = {
...this.printImports[nexusSchemaImportId],
core: true,
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/kitchenSink/__typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Do not make changes to this file directly
*/

import type { core, connectionPluginCore } from '../../../src'
import type { connectionPluginCore, core } from '../../../src'
declare global {
interface NexusGenCustomInputMethods<TypeName extends string> {
/**
Expand Down