DOC HistoryViewer: explain "magic names" (#9670)

DOC HistoryViewer: explain "magic names"
GraphQL scaffolding uses names consisting of the first part of the namespace and the classname, but to inject it to the HistoryViewer field you need to use the database table name.
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
This commit is contained in:
cloph 2020-09-12 02:56:23 +02:00 committed by GitHub
parent 015ea8cfc8
commit 13725d2f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1243,6 +1243,22 @@ window.document.addEventListener('DOMContentLoaded', () => {
);
});
```
[hint]
GraphQL scaffolding derives the names for the schema from the first part of the namespace and the classname, while in
the Injector the database table name is used. So in the case of
```php
namespace Foo\Bar;
// …
class MyVersionedObject extends DataObject
{
private static $table_name = 'MyTableName';
// …
}
```
you would have to use `readOneFooMyVersionedObject`, `rollbackFooMyVersionedObject` and
`HistoryViewerToolbar.VersionedAdmin.HistoryViewer.MyTableName.HistoryViewerVersionDetail` respectively
[/hint]
For more information, see [ReactJS, Redux and GraphQL](../../customising_the_admin_interface/react_redux_and_graphql).