blueo

FWIW I've had site config objects created in a test that then hang over into the main DB. Something to do with SiteConfig::create() vs SiteConfig::current_site_config()

blueo

I've used this to setup a temp asset store that gets removed after the test. But maybe not what you're asking:

  1. protected function setUp(): void
  2. {
  3. parent::setUp();
  4.  
  5.  
  6. TestAssetStore::activate('ImageTest');
  7. }
  8.  
  9.  
  10. protected function tearDown(): void
  11. {
  12. TestAssetStore::reset();
  13.  
  14.  
  15. parent::tearDown();
  16. }
👍 (2)
blueo

if it is a connection do you need the edges { node { part?

blueo

if so you may need :

  1. query myQuery {
  2. Regions {
  3. ID,
  4. Title
  5. }
  6. }
blueo

yeah i believe so - you can use the scaffolder to create the types from the region/topic data objects

blueo

you could define your own type like so: https://github.com/silverstripe/silverstripe-graphql#define-types then have a custom query/resolver that returns your type (which has a list of regions/topics Type::listOf($this->manager->getType('region')))

Show 1 attachment(s)
GitHub  
silverstripe/silverstripe-graphql

Serves SilverStripe data as GraphQL representations - silverstripe/silverstripe-graphql

Hide attachment content
blueo

I think $CurrentLocale just returns the locale code eg en_NZ. You could always create a function to return the locale object - if you want it globally you can define a template provider like in vendor/tractorcow/silverstripe-fluent/src/View/FluentTemplateGlobalProvider.php