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 20, 2024
1 parent 464105c commit 32ede20
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 1,348 deletions.
40 changes: 0 additions & 40 deletions _config/graphql-legacy.yml

This file was deleted.

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;
146 changes: 0 additions & 146 deletions client/src/state/files/_legacy/readFilesQuery.js

This file was deleted.

51 changes: 0 additions & 51 deletions client/src/state/files/_legacy/readOneFileQuery.js

This file was deleted.

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.

Loading

0 comments on commit 32ede20

Please sign in to comment.