Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Remove unused legacy graphql code #1787

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions _config/graphql-schema-admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ SilverStripe\Core\Injector\Injector:
on: [ graphqlSchemaBuild.admin ]
handler: '%$SilverStripe\GraphQL\Schema\Services\SchemaTranscribeHandler'



SilverStripe\Admin\LeftAndMain:
graphql_legacy: false

SilverStripe\GraphQL\Schema\Schema:
schemas:
admin:
Expand Down
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

28 changes: 3 additions & 25 deletions client/src/boot/apollo/getGraphqlFragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,9 @@ const handleError = response => {
return response;
};

const getGraphqlFragments = async (baseUrl, preferStatic = true) => {
// Backward compatibility hack. Remove when GraphQL 4 is in core
const isLegacy = !!document.body.getAttribute('data-graphql-legacy');

const urls = [
joinUrlPaths(baseUrl, '_graphql/admin.types.graphql'),
joinUrlPaths(baseUrl, 'admin.types.graphql'),
];

const legacyURLs = [
joinUrlPaths(baseUrl, 'admin/graphql/types'),
joinUrlPaths(baseUrl, 'assets/admin.types.graphql'),
];

let primaryURL;
let fallbackURL;

if (isLegacy) {
if (preferStatic) {
legacyURLs.reverse();
}
[primaryURL, fallbackURL] = legacyURLs;
} else {
[primaryURL, fallbackURL] = urls;
}
const getGraphqlFragments = async (baseUrl) => {
const primaryURL = joinUrlPaths(baseUrl, '_graphql/admin.types.graphql');
const fallbackURL = joinUrlPaths(baseUrl, 'admin.types.graphql');

const fetchConfig = {
method: 'GET',
Expand Down
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
},
"autoload": {
"psr-4": {
"SilverStripe\\Admin\\": [
"code/",
"_legacy/"
],
"SilverStripe\\Admin\\": "code/",
"SilverStripe\\Admin\\Tests\\": "tests/php/",
"SilverStripe\\Admin\\Tests\\Behat\\Context\\": "tests/behat/src/"
}
Expand Down
2 changes: 1 addition & 1 deletion templates/SilverStripe/Admin/CMSDialog.ss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>$Title</title>
</head>

<body class="cms cms-dialog $BaseCSSClasses" lang="$Locale.RFC1766" <% if $GraphQLLegacy %>data-graphql-legacy="1"<% end_if %>>
<body class="cms cms-dialog $BaseCSSClasses" lang="$Locale.RFC1766">
<div class="cms-dialog-content">
$Content
$Form
Expand Down
2 changes: 1 addition & 1 deletion templates/SilverStripe/Admin/LeftAndMain.ss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>$Title</title>
</head>
<body class="loading cms" data-frameworkpath="$ModulePath(silverstripe/framework)"
data-member-tempid="$CurrentMember.TempIDHash.ATT" <% if $GraphQLLegacy %>data-graphql-legacy="1"<% end_if %>
data-member-tempid="$CurrentMember.TempIDHash.ATT"
>
<% include SilverStripe\\Admin\\CMSLoadingScreen %>

Expand Down
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6719,7 +6719,7 @@ get-func-name@^2.0.1:
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41"
integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==

get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
get-intrinsic@^1.0.2, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd"
integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==
Expand Down Expand Up @@ -9637,7 +9637,7 @@ object-assign@^4.1.0, object-assign@^4.1.1:
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==

object-inspect@^1.13.1:
object-inspect@^1.13.1, object-inspect@^1.9.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2"
integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==
Expand Down Expand Up @@ -11269,7 +11269,7 @@ set-blocking@^2.0.0:
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==

set-function-length@^1.1.1:
set-function-length@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449"
integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==
Expand Down Expand Up @@ -12767,6 +12767,7 @@ wordwrap@^1.0.0:
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down
Loading