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

Remove experimental.generateNodeAPI #7957

Merged
merged 8 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move getContext to a different entrypoint
  • Loading branch information
emmatown committed Sep 27, 2022
commit 8f9028dd4b0b8944f68a86fbe9fb7238c4d7a3f3
2 changes: 1 addition & 1 deletion examples/embedded-nextjs/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default function HomePage({ posts }) {

export async function getStaticProps() {
const context = await withContext();
const posts = await context.lists.Post.findMany({ query: 'slug title' });
const posts = await context.query.Post.findMany({ query: 'slug title' });
return { props: { posts } };
}
2 changes: 1 addition & 1 deletion examples/script/script.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getContext } from '@keystone-6/core/system';
import { getContext } from '@keystone-6/core/context';
import config from './keystone';
import * as PrismaModule from '.prisma/client';

Expand Down
4 changes: 4 additions & 0 deletions packages/core/context/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"main": "dist/keystone-6-core-context.cjs.js",
"module": "dist/keystone-6-core-context.esm.js"
}
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"fields",
"types",
"system",
"context",
"access"
],
"dependencies": {
Expand Down Expand Up @@ -132,6 +133,7 @@
"___internal-do-not-use-will-break-in-patch/admin-ui/pages/*/index.tsx",
"___internal-do-not-use-will-break-in-patch/admin-ui/{next-config.ts,id-field-view.tsx}",
"artifacts.ts",
"context.ts",
"migrations.ts",
"testing.ts",
"session/index.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { getContext } from './lib/getContext';
3 changes: 2 additions & 1 deletion packages/core/src/lib/getContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSystem, initConfig } from '../system';
import { BaseKeystoneTypeInfo, KeystoneConfig, KeystoneContext } from '../types';
import { initConfig } from './config/initConfig';
import { createSystem } from './createSystem';

export function getContext<TypeInfo extends BaseKeystoneTypeInfo>(
config: KeystoneConfig<TypeInfo>,
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export { createExpressServer } from './lib/server/createExpressServer';
export { createAdminUIMiddleware } from './lib/server/createAdminUIMiddleware';
export { initConfig } from './lib/config/initConfig';
export { createApolloServerMicro } from './lib/server/createApolloServer';
export { getContext } from './lib/getContext';