Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH Remove unused legacy graphql code
Browse files Browse the repository at this point in the history
emteknetnz committed Jun 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 464105c commit b92665d
Showing 15 changed files with 18 additions and 1,151 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
@@ -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
@@ -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/"
}
70 changes: 0 additions & 70 deletions tests/php/GraphQL/Legacy/CreateFolderMutationCreatorTest.php

This file was deleted.

Loading

0 comments on commit b92665d

Please sign in to comment.