Skip to content

Commit

Permalink
ENH Remove unused legacy graphql code
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 18, 2024
1 parent 464105c commit 5e906e0
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 1,111 deletions.
4 changes: 2 additions & 2 deletions client/dist/js/bundle.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions client/src/boot/registerQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ import Injector from 'lib/Injector';
import { fileInterface, file } from 'lib/fileFragments';
import readFilesQuery from 'state/files/readFilesQuery';
import readOneFileQuery from 'state/files/readOneFileQuery';
import readFilesQueryLegacy from 'state/files/_legacy/readFilesQuery';
import readDescendantFileCountsQuery from 'state/files/readDescendantFileCountsQuery';
import readOneFileQueryLegacy from 'state/files/_legacy/readOneFileQuery';
import readFileUsageQuery from 'state/files/readFileUsageQuery';

// Backward compatibility hack. Remove when GraphQL 4 is in core
const isLegacy = !!document.body.getAttribute('data-graphql-legacy');

const registerQueries = () => {
Injector.query.registerFragment('FileInterfaceFields', fileInterface);
Injector.query.registerFragment('FileFields', file);
Injector.query.register('ReadFilesQuery', isLegacy ? readFilesQueryLegacy : readFilesQuery);
Injector.query.register('ReadFilesQuery', readFilesQuery);
Injector.query.register('readDescendantFileCountsQuery', readDescendantFileCountsQuery);
Injector.query.register('ReadOneFileQuery', isLegacy ? readOneFileQueryLegacy : readOneFileQuery);
Injector.query.register('ReadOneFileQuery', readOneFileQuery);
Injector.query.register('readFileUsageQuery', readFileUsageQuery);
};
export default registerQueries;
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
},
"autoload": {
"psr-4": {
"SilverStripe\\AssetAdmin\\": [
"code/",
"_legacy/"
],
"SilverStripe\\AssetAdmin\\": "code/",
"SilverStripe\\AssetAdmin\\Tests\\": "tests/php/",
"SilverStripe\\AssetAdmin\\Tests\\Behat\\Context\\": "tests/behat/src/"
}
Expand Down
70 changes: 0 additions & 70 deletions tests/php/GraphQL/Legacy/CreateFolderMutationCreatorTest.php

This file was deleted.

291 changes: 0 additions & 291 deletions tests/php/GraphQL/Legacy/FileFilterInputTypeCreatorTest.php

This file was deleted.

Loading

0 comments on commit 5e906e0

Please sign in to comment.