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

[base] A fix + example schema demonstrating named reference types #117

Merged
merged 1 commit into from
Aug 18, 2017

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Aug 17, 2017

This fixes an issue with previews that broke when you had named reference types in arrays / block editor, and adds a few examples of named reference types to the example-studio schema, see:

{
name: 'arrayOfNamedReferences',
type: 'array',
of: [
{
type: 'reference',
name: 'authorReference',
to: [{type: 'author', title: 'Reference to author'}]
},
{
type: 'reference',
name: 'blogpostReference',
to: [{type: 'blogpost', title: 'Reference to blog post'}]
}
]
}
]

and
{
type: 'reference', name: 'authorReference',
to: {type: 'author'},
title: 'Reference to author'
},
{
type: 'reference',
name: 'blogpostReference',
to: {type: 'blogpost'},
title: 'Reference to blogpost'
},

(cc @skogsmaskin, @simen)

@bjoerge bjoerge force-pushed the feature/support-named-reference-types branch from b26faff to 23d3afe Compare August 18, 2017 08:27
@bjoerge bjoerge requested a review from rexxars August 18, 2017 10:05
@rexxars
Copy link
Member

rexxars commented Aug 18, 2017

Is the name stored in any way in the actual data? If so, on which property?

@bjoerge
Copy link
Member Author

bjoerge commented Aug 18, 2017

The name will be stored on _type, e.g.:

{_type: 'authorReference', _ref: 'henrik-ibsen'}

@rexxars
Copy link
Member

rexxars commented Aug 18, 2017

LGTM.

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.

2 participants