Created
December 5, 2023 23:34
-
-
Save maxime-rainville/cf52ac57469084cc0102a6a3a101c597 to your computer and use it in GitHub Desktop.
Example of how to overide asset-admin GraphQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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]), | |
# it will be merged with the pre-existing value. By using the string | |
# callabale syntax, we'll override the existing value instead | |
resolver: 'MyFolderTypeResolver::sortChildren' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/_config/graphql.yml | |
# This will be merged with the content of vendor/silverstripe/asset-admin/_config/graphql.yml | |
# The actual source src for your admin schema will be something like this | |
# - assetAdmin: 'silverstripe/asset-admin: _graphql' | |
# - myAssetAdmin: 'app/_graphql' | |
--- | |
Name: my-asset-admin-graphql | |
After: | |
- '#asset-admin-graphql' | |
--- | |
SilverStripe\GraphQL\Schema\Schema: | |
schemas: | |
admin: | |
src: | |
myAssetAdmin: 'app/_graphql' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment