mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
015ea8cfc8
commit
13725d2f92
@ -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).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user