-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Singletons #7863
Merged
Merged
Singletons #7863
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as resolved.
This comment was marked as resolved.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 7050783:
|
emmatown
force-pushed
the
singletons-as-lists
branch
from
August 30, 2022 05:51
fd17e6b
to
b483800
Compare
emmatown
force-pushed
the
singletons-as-lists
branch
from
August 30, 2022 06:15
b483800
to
eddbb52
Compare
emmatown
force-pushed
the
singletons-as-lists
branch
from
August 30, 2022 06:28
eddbb52
to
11588af
Compare
emmatown
force-pushed
the
singletons-as-lists
branch
from
August 30, 2022 06:47
11588af
to
4e80266
Compare
emmatown
force-pushed
the
singletons-as-lists
branch
from
August 30, 2022 06:55
4e80266
to
e602af2
Compare
emmatown
force-pushed
the
singletons-as-lists
branch
from
August 30, 2022 07:12
e602af2
to
075abb5
Compare
Noviny
force-pushed
the
singletons-as-lists
branch
from
September 6, 2022 00:27
1f4aca0
to
1d77442
Compare
emmatown
commented
Sep 6, 2022
.../core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx
Outdated
Show resolved
Hide resolved
emmatown
commented
Sep 6, 2022
emmatown
commented
Sep 6, 2022
dcousens
force-pushed
the
singletons-as-lists
branch
from
September 7, 2022 04:07
6cf6ef1
to
60c9429
Compare
dcousens
approved these changes
Sep 7, 2022
Merged
dcousens
force-pushed
the
singletons-as-lists
branch
from
September 7, 2022 05:35
4b21dfb
to
8958469
Compare
dcousens
force-pushed
the
singletons-as-lists
branch
from
September 7, 2022 05:41
8958469
to
7050783
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a newsingleton
list function for configuring lists as singletons.update: See #7941, we now prefer
isSingleton: true
, not a functionSee below for an example of configuring a singleton:
Setting this flag does a few things:
In Graphql
Graphql queries for singletons are all the same as those for lists, however with two major differences:
where: { id: '1' }
, you will get an error - you can only read, create, update, or delete an item with an ID of 1 in singleton.where
query for singletons, meaning you can simply not provide it, so you don't need to think about the aboveSo for example, the query for the above singleton would be:
NB: This is a query for a single
settings
In the admin UI
{ThisSingleton} doesn't exist or you don't have access to it.
In Keystone
DX Design Notes
If the plural of a singleton is ambiguous, singleton lists default to the plural
Many${ListName}
.This should typically be unambiguous.
We have retained the many query support for singletons to maximize compatibility and keep support for generic functions across lists that may or may not be singletons.