diff --git a/en/02_Developer_Guides/19_GraphQL/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md b/en/02_Developer_Guides/19_GraphQL/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md index 1f8aa03d6..ecf605f6d 100644 --- a/en/02_Developer_Guides/19_GraphQL/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md +++ b/en/02_Developer_Guides/19_GraphQL/02_working_with_dataobjects/01_adding_dataobjects_to_the_schema.md @@ -204,15 +204,16 @@ A couple things to note here: * By assigning a value of `true` to the field, we defer to the model to infer the type for the field. To override that, we can always add a `type` property: -```yaml -MyProject\Models\Product: - fields: - onSale: - type: Boolean -``` + ```yaml + MyProject\Models\Product: + fields: + onSale: + type: Boolean + ``` * The mapping of our field names to the `DataObject` property is case-insensitive. It is a convention in GraphQL APIs to use lowerCamelCase fields, so this is given by default. + [/notice] ### Bulk loading models @@ -239,9 +240,9 @@ elemental: # An arbitrary key to define what these directives are doing load: inheritanceLoader: include: - - DNADesign\Elemental\Models\BaseElement + - DNADesign\Elemental\Models\BaseElement exclude: - - MyApp\Elements\MySecretElement + - MyApp\Elements\MySecretElement # Add all fields and read operations apply: fields: diff --git a/en/03_Upgrading/07_Upgrading_Fluent.md b/en/03_Upgrading/07_Upgrading_Fluent.md index b18bf1df1..3435813b9 100644 --- a/en/03_Upgrading/07_Upgrading_Fluent.md +++ b/en/03_Upgrading/07_Upgrading_Fluent.md @@ -132,14 +132,14 @@ The following actions in the history tab in the CMS are affected: ### Standard Versioned methods -Fluent 6 alters how many of the [`Versioned`](api:SilverStripe/Versioned/Versioned) methods work as the data source is changed to use the localised tables. This has a large impact on the CMS UI and behaviour (as mentioned in the previous section). +Fluent 6 alters how many of the [`Versioned`](api:SilverStripe\Versioned\Versioned) methods work as the data source is changed to use the localised tables. This has a large impact on the CMS UI and behaviour (as mentioned in the previous section). Examples of impacted methods: -- [`isOnDraft()`](api:SilverStripe/Versioned/Versioned::isOnDraft()) -- [`isPublished()`](api:SilverStripe/Versioned/Versioned::isPublished()) -- [`isArchived()`](api:SilverStripe/Versioned/Versioned::isArchived()) -- [`stagesDiffer()`](api:SilverStripe/Versioned/Versioned::stagesDiffer()) +- [`isOnDraft()`](api:SilverStripe\Versioned\Versioned::isOnDraft()) +- [`isPublished()`](api:SilverStripe\Versioned\Versioned::isPublished()) +- [`isArchived()`](api:SilverStripe\Versioned\Versioned::isArchived()) +- [`stagesDiffer()`](api:SilverStripe\Versioned\Versioned::stagesDiffer()) Simply put, any code you have checking the versioned state of a record used to return results for the base (unlocalised) record. To get the result for the localised record, specialised methods had to be called. @@ -243,9 +243,9 @@ These changes aren't likely to break anything in your project, but we recommend Some unit tests may break. There's no one solution for problems you may encounter, but some general recommendations that might help are: - avoid localised tables in yaml fixtures - - localise models in your PHP code instead, either in the `setUp()` method or via ORM calls (for example explicitly calling [`$obj->write()`](api:SilverStripe/ORM/DataObject::write()) after fetching the fixture object) + - localise models in your PHP code instead, either in the `setUp()` method or via ORM calls (for example explicitly calling [`$obj->write()`](api:SilverStripe\ORM\DataObject::write()) after fetching the fixture object) - avoid including version history in your yaml fixtures - - use ORM methods like [`$obj->publishRecursive()`](api:SilverStripe/Versioned/RecursivePublishable:publishRecursive()) after fetching the fixture objects instead + - use ORM methods like [`$obj->publishRecursive()`](api:SilverStripe\Versioned\RecursivePublishable:publishRecursive()) after fetching the fixture objects instead ## Further reading