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

[Breaking graphiql Bug] Cannot load graphiql with new resource location #83

Closed
rwilliams-r7 opened this issue Jun 5, 2018 · 9 comments

Comments

@rwilliams-r7
Copy link

rwilliams-r7 commented Jun 5, 2018

New resource location does not load within graphiql.html. Reference's seem to need to be updated to

   <script src="./static/vendor/es6-promise.auto.min.js"></script>
    <script src="./static/vendor/fetch.min.js"></script>
    <script src="./static/vendor/react.min.js"></script>
    <script src="./static/vendor/react-dom.min.js"></script>

    <link rel="stylesheet" href="./static/vendor/graphiql.min.css" />
    <script src="./static/vendor/graphiql.min.js"></script>

Without this change the graphiql page does not load.

@kganger
Copy link

kganger commented Jun 13, 2018

similar issue. I remapped graphiql to /app/graphiql as allowed by the framework. The page will not load because the resource paths are hard coded.

@rwilliams-r7
Copy link
Author

@apottere any update on if you have seen the same problem?

@breun
Copy link

breun commented Jul 9, 2018

@rwilliams-r7 Maybe you can create a pull request with the fix you suggested?

@oliemansm
Copy link
Member

Actually just removing the dots will suffice:

    <script src="/vendor/es6-promise.auto.min.js"></script>
    <script src="/vendor/fetch.min.js"></script>
    <script src="/vendor/react.min.js"></script>
    <script src="/vendor/react-dom.min.js"></script>

    <link rel="stylesheet" href="/vendor/graphiql.min.css" />
    <script src="/vendor/graphiql.min.js"></script>

I'll change it.

@liangjacky
Copy link

This seems to happen still.

My dependency versions are

    <dependency>
      <groupId>com.graphql-java</groupId>
      <artifactId>graphql-spring-boot-starter</artifactId>
      <version>5.0.2</version>
    </dependency>
    <dependency>
      <groupId>com.graphql-java</groupId>
      <artifactId>graphiql-spring-boot-starter</artifactId>
      <version>5.0.2</version>
    </dependency>

@breun
Copy link

breun commented Nov 12, 2018

@liangjacky These artifacts have moved to another groupId with version 5.0.3: com.graphql-java-kickstart. The current version is 5.0.6. See the release notes for more info: https://github.com/graphql-java-kickstart/graphql-spring-boot/releases

@ishaish103
Copy link

ishaish103 commented Jan 14, 2020

still reproduces..any solution?

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-data-jpa</artifactId>
	</dependency>
	<dependency>
		<groupId>com.graphql-java-kickstart</groupId>
		<artifactId>graphql-spring-boot-starter</artifactId>
		<version>6.0.1</version>
	</dependency>
	<dependency>
		<groupId>com.graphql-java-kickstart</groupId>
		<artifactId>graphiql-spring-boot-starter</artifactId>
		<version>6.0.1</version>
	</dependency>
	<dependency>
		<groupId>com.graphql-java-kickstart</groupId>
		<artifactId>graphql-java-tools</artifactId>
		<version>5.7.1</version>
	</dependency>
	<dependency>
		<groupId>com.h2database</groupId>
		<artifactId>h2</artifactId>
		<version>1.4.199</version>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<version>1.18.8</version>
		<optional>true</optional>
	</dependency>
	<dependency>
		<groupId>com.graphql-java</groupId>
		<artifactId>graphql-java-extended-scalars</artifactId>
		<version>1.0.1</version>
	</dependency>
	<dependency>
		<groupId>org.reactivestreams</groupId>
		<artifactId>reactive-streams</artifactId>
		<version>1.0.3</version>
	</dependency>
	<dependency>
		<groupId>org.reactivestreams</groupId>
		<artifactId>reactive-streams-tck</artifactId>
		<version>1.0.3</version>
	</dependency>
	<dependency>
		<groupId>org.reactivestreams</groupId>
		<artifactId>reactive-streams-tck-flow</artifactId>
		<version>1.0.3</version>
	</dependency>
	<dependency>
		<groupId>io.reactivex.rxjava3</groupId>
		<artifactId>rxjava</artifactId>
		<version>3.0.0-RC7</version>
	</dependency>
	<dependency>
		<groupId>org.reactivestreams</groupId>
		<artifactId>reactive-streams-examples</artifactId>
		<version>1.0.3</version>
	</dependency>
</dependencies>

@dalegaspi
Copy link

this was a problem for me and for some reason it doesn't work unless i create a bean that extends WebMvcAutoConfiguration (creating a bean that implements WebMvcConfigurer or extending WebMvcConfigurerAdapter does not work)

what i ended up doing is using the CDN option via the application.properties or application.yml

graphql:
  playground:
    cdn:
      enabled: true
      version: 1.7.20

this obviously serves up the static resources from the CDN, but it should suffice for my use.

@erdenebadral
Copy link

I have solved graphiql and voyager with WebMvcConfigurer below code:

registry
        .addResourceHandler("/vendor/**")
        .addResourceLocations("classpath:/static/vendor/");

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants