Skip to content

Commit

Permalink
Merge pull request #1474 from creative-commoners/pulls/2/remove-legacy
Browse files Browse the repository at this point in the history
ENH Remove unused legacy graphql code
  • Loading branch information
GuySartorelli authored Jun 21, 2024
2 parents 430bb8b + 32ede20 commit dac10e1
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 dac10e1

Please sign in to comment.