keystone
keystone copied to clipboard
Singletons
This pull request introduces Singletons as a new feature for configuring global, editable database entries when it's not necessary to have more than one representation of the schema (aka, not a normal list).
Singletons can be useful for things like:
- System Settings
- Homepage Layout
- Site Navigation
Before this feature, developers could write a typical schema for a list, and then using Keystone hooks limit the number of items within that list to approximate this functionality. Unfortunately the GraphQL schema didn't reflect these constraints, and neither did the AdminUI.
This pull requests brings that functionality native to Keystone's schema configuration as a first class primitive.
Tasks
- [ ] Add enforcement of the databases (where able) to ensure that the singleton list only ever has one item
- [x] Alter the graphql layer so that queries on singletons make more sense (remove querying for multiple items, remove the ‘where’ query on fetching a single item, as there will only ever be one)
- [x] Update the Admin UI - mostly subtractive changes to give a good experience for singletons where navigating items UI is removed, removing clicks
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
keystone-next-docs | ❌ Failed (Inspect) | Aug 24, 2022 at 11:58PM (UTC) |
⚠️ No Changeset found
Latest commit: dbd9701c66c06346d3e905c18754f4ae7a66ff82
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
I am really looking forward to this feature. Are you able to estimate when singletons will be available in keystone?
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 8424dfa998e3eea81acdef74230746bd86e183e1:
Sandbox | Source |
---|---|
@keystone-6/sandbox | Configuration |
Replaced by #7863