Skip to content

Instantly share code, notes, and snippets.

View maxime-rainville's full-sized avatar

Maxime Rainville maxime-rainville

View GitHub Profile
@maxime-rainville
maxime-rainville / Folder.yml
Created December 5, 2023 23:34
Example of how to overide asset-admin GraphQL
# app/_graphql/types/Folder.yml
# This will be merged with vendor/silverstripe/asset-admin/_graphql/types/Folder.yml
Folder:
fields:
'children(filter: FileFilterInput)':
type: '[FileInterface]'
plugins:
sorter:
# If we used the array syntax (e.g. [MyFolderTypeResolver, sortChildren]),
@maxime-rainville
maxime-rainville / Company.php
Created December 6, 2023 04:45
Test of ViewableData Gridfield
<?php
use SilverStripe\View\ArrayData;
class Company extends ArrayData
{
public function __construct($id=0, $data=[])
{
if (empty($data)) {
Go look under papa's chair.
@maxime-rainville
maxime-rainville / company.yml
Last active April 19, 2025 09:37
Very simple Sliverstripe GraphQL schema set up (assumes you have installed silverstripe/frameworktest)
# app/_graphql/models/company.yml
SilverStripe\FrameworkTest\Model\Company:
fields: '*'
operations:
'*': true