Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit ac3034b

Browse files
committed
fix(*): GraphiQL && Voyager resources
1 parent 94bee25 commit ac3034b

File tree

21 files changed

+548
-677
lines changed

21 files changed

+548
-677
lines changed

example/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ repositories {
3838
dependencies{
3939
compile(project(":graphql-spring-boot-starter"))
4040
compile(project(":graphiql-spring-boot-starter"))
41-
41+
compile(project(":voyager-spring-boot-starter"))
42+
4243
compile("org.springframework.boot:spring-boot-starter-web:$LIB_SPRING_BOOT_VER")
4344
compile("org.springframework.boot:spring-boot-starter-actuator:$LIB_SPRING_BOOT_VER")
4445
}

example/src/main/resources/application.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ graphql:
1717
actuator-metrics: true
1818
graphiql:
1919
enabled: true
20+
voyager:
21+
enabled: true

graphiql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphiql/boot/GraphiQLController.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public class GraphiQLController {
5353
@Value("${graphiql.pageTitle:GraphiQL}")
5454
private String pageTitle;
5555

56-
@Value("${graphiql.cdn.enabled:false}")
56+
@Value("${graphiql.cdn.enabled:true}")
5757
private Boolean graphiqlCdnEnabled;
5858

59-
@Value("${graphiql.cdn.version:0.12.0}")
59+
@Value("${graphiql.cdn.version:0.13.0}")
6060
private String graphiqlCdnVersion;
6161

6262
@Value("${graphiql.subscriptions.timeout:30}")
@@ -121,41 +121,41 @@ private Map<String, String> getReplacements(String graphqlEndpoint, String subsc
121121
replacements.put("staticBasePath", staticBasePath);
122122
replacements.put("pageTitle", pageTitle);
123123
replacements.put("es6PromiseJsUrl", getCdnJsUrl(staticBasePath, graphiqlCdnEnabled, ES_6_PROMISE,
124-
"4.1.1", "es6-promise.auto.min.js"));
124+
"4.1.1", "es6-promise.auto.min.js", "es6-promise.auto.min.js"));
125125
replacements.put("fetchJsUrl", getCdnJsUrl(staticBasePath, graphiqlCdnEnabled, FETCH,
126-
"3.0.0", "fetch.min.js"));
126+
"2.0.4", "fetch.min.js", "fetch.min.js"));
127127
replacements.put("reactJsUrl", getCdnJsUrl(staticBasePath, graphiqlCdnEnabled, REACT,
128-
"16.8.3", "react.production.min.js"));
128+
"16.8.3", "umd/react.production.min.js", "react.min.js"));
129129
replacements.put("reactDomJsUrl", getCdnJsUrl(staticBasePath, graphiqlCdnEnabled, REACT_DOM,
130-
"16.8.3", "react-dom.production.min.js"));
131-
replacements.put("graphiqlCssUrl", getCdnJsUrl(staticBasePath, graphiqlCdnEnabled, GRAPHIQL,
132-
graphiqlCdnVersion, "graphiql.min.css"));
133-
replacements.put("graphiqlJsUrl", getCdnJsUrl(staticBasePath, graphiqlCdnEnabled, GRAPHIQL,
134-
graphiqlCdnVersion, "graphiql.min.js"));
130+
"16.8.3", "umd/react-dom.production.min.js", "react-dom.min.js"));
131+
replacements.put("graphiqlCssUrl", getJsDelivrUrl(staticBasePath, graphiqlCdnEnabled, GRAPHIQL,
132+
graphiqlCdnVersion, "graphiql.css", "graphiql.min.css"));
133+
replacements.put("graphiqlJsUrl", getJsDelivrUrl(staticBasePath, graphiqlCdnEnabled, GRAPHIQL,
134+
graphiqlCdnVersion, "graphiql.min.js", "graphiql.min.js"));
135135
replacements.put("subscriptionsTransportWsBrowserClient", getJsDelivrUrl(staticBasePath, graphiqlCdnEnabled,
136-
SUBSCRIPTIONS_TRANSPORT_WS, "@0.9.15", "browser/client.js",
137-
"subscriptions-transport-ws-browser-client-0.9.15.js"));
136+
SUBSCRIPTIONS_TRANSPORT_WS, "0.9.15", "browser/client.js",
137+
"subscriptions-transport-ws-browser-client.js"));
138138
replacements.put("graphiqlSubscriptionsFetcherBrowserClient", getJsDelivrUrl(staticBasePath, graphiqlCdnEnabled,
139-
GRAPHIQL_SUBSCRIPTIONS_FETCHER, "@0.0.2", "browser/client.js",
140-
"graphiql-subscriptions-fetcher-browser-client-0.0.2.js"));
139+
GRAPHIQL_SUBSCRIPTIONS_FETCHER, "0.0.2", "browser/client.js",
140+
"graphiql-subscriptions-fetcher-browser-client.js"));
141141
replacements.put("props", props);
142142
replacements.put("headers", headers);
143143
replacements.put("subscriptionClientTimeout", String.valueOf(subscriptionsTimeout));
144144
return replacements;
145145
}
146146

147147
private String getCdnJsUrl(String staticBasePath, Boolean isCdnEnabled, String library,
148-
String cdnVersion, String filename) {
148+
String cdnVersion, String cdnFileName, String filename) {
149149
if (isCdnEnabled && StringUtils.isNotBlank(cdnVersion)) {
150-
return CDNJS_CLOUDFLARE_COM_AJAX_LIBS + library + cdnVersion + "/" + filename;
150+
return CDNJS_CLOUDFLARE_COM_AJAX_LIBS + library + "/" + cdnVersion + "/" + cdnFileName;
151151
}
152152
return staticBasePath + "vendor/" + filename;
153153
}
154154

155155
private String getJsDelivrUrl(String staticBasePath, Boolean isCdnEnabled, String library,
156156
String cdnVersion, String cdnFileName, String filename) {
157157
if (isCdnEnabled && StringUtils.isNotBlank(cdnVersion)) {
158-
return CDN_JSDELIVR_NET_NPM + library + "/" + cdnVersion + "/" + cdnFileName;
158+
return CDN_JSDELIVR_NET_NPM + library + "@" + cdnVersion + "/" + cdnFileName;
159159
}
160160
return staticBasePath + "vendor/" + filename;
161161
}

graphiql-spring-boot-autoconfigure/src/main/resources/static/vendor/es6-promise.auto.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)