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

Move defaults to initConfig #9027

Merged
merged 6 commits into from Feb 15, 2024
Merged

Move defaults to initConfig #9027

merged 6 commits into from Feb 15, 2024

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented Feb 15, 2024

This is a work in progress, and will probably span many pull requests, but wherever possible, we want to move the defaults into initConfig. In the next major, initConfig will be removed in favour of this being internally managed only; allowing us to refine the internally used types to something stricter than KeystoneConfig.

@dcousens dcousens force-pushed the central-defaults branch 5 times, most recently from e1b90ec to e3f9b63 Compare February 15, 2024 02:16
Copy link

codesandbox-ci bot commented Feb 15, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4860d3e:

Sandbox Source
@keystone-6/sandbox Configuration

@dcousens dcousens force-pushed the central-defaults branch 2 times, most recently from 489db49 to 5f3f5b5 Compare February 15, 2024 03:37
@@ -4,7 +4,7 @@ import { createRequire } from 'node:module'
import { printSchema, GraphQLSchema } from 'graphql'
import { getGenerators, formatSchema } from '@prisma/internals'
import type { KeystoneConfig } from './types'
import { printGeneratedTypes } from './lib/schema-type-printer'
import { printGeneratedTypes } from './lib/typescript-schema-printer'
Copy link
Member Author

@dcousens dcousens Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to align with prisma-schema-printer.ts, I don't know why it was .tsx

@dcousens dcousens merged commit 18eed93 into main Feb 15, 2024
58 checks passed
@dcousens dcousens deleted the central-defaults branch February 15, 2024 03:49
'@keystone-6/core': patch
----

Use `idField` type of `{ kind: 'number', kind: 'Int' | 'BigInt' }` internally for singletons
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just have static value for this?

may be global-config or settings or just add to list config applicable when isSingleton is true;

Copy link
Member Author

@dcousens dcousens Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gautamsi I didn't see a reason why we should prevent developers from having this kind of identifier type available for their own usage, while additionally allowing me me to remove isSingleton logic from the id-field

@dcousens dcousens mentioned this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants