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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type { OrmClientConfig, QueryResult, GraphQLError } from "./client";
export { GraphQLRequestError } from "./client";
export { QueryBuilder } from "./query-builder";
export * from "./select-types";
export * from "./models";
/**
* Create an ORM client instance
*
Expand Down Expand Up @@ -61,6 +62,9 @@ export type { OrmClientConfig, QueryResult, GraphQLError } from "./client";
export { GraphQLRequestError } from "./client";
export { QueryBuilder } from "./query-builder";
export * from "./select-types";
export * from "./models";
export { createQueryOperations } from "./query";
export { createMutationOperations } from "./mutation";
/**
* Create an ORM client instance
*
Expand Down
34 changes: 34 additions & 0 deletions graphql/codegen/src/cli/codegen/orm/client-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,40 @@ export function generateCreateClientFile(
// export * from './select-types';
statements.push(t.exportAllDeclaration(t.stringLiteral('./select-types')));

// Re-export all models for backwards compatibility
// export * from './models';
statements.push(t.exportAllDeclaration(t.stringLiteral('./models')));

// Re-export custom operations for backwards compatibility
if (hasCustomQueries) {
statements.push(
t.exportNamedDeclaration(
null,
[
t.exportSpecifier(
t.identifier('createQueryOperations'),
t.identifier('createQueryOperations')
),
],
t.stringLiteral('./query')
)
);
}
if (hasCustomMutations) {
statements.push(
t.exportNamedDeclaration(
null,
[
t.exportSpecifier(
t.identifier('createMutationOperations'),
t.identifier('createMutationOperations')
),
],
t.stringLiteral('./mutation')
)
);
}

// Build the return object properties
const returnProperties: t.ObjectProperty[] = [];

Expand Down