File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed
src/main/java/soham/spring/graphqljava Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 1313 <version >0.0.1-SNAPSHOT</version >
1414 <name >spring-graphql-java</name >
1515 <description >Spring Boot project to demonstrate GraphQL with graphql-java</description >
16+
1617 <properties >
1718 <java .version>11</java .version>
19+ <graphql-java-version >16.2</graphql-java-version >
20+ <graphql-java-spring-boot-starter-webmvc-version >2.0</graphql-java-spring-boot-starter-webmvc-version >
1821 </properties >
22+
1923 <dependencies >
2024 <dependency >
2125 <groupId >org.springframework.boot</groupId >
4953 <dependency >
5054 <groupId >com.graphql-java</groupId >
5155 <artifactId >graphql-java</artifactId >
52- <version >16.2 </version >
56+ <version >${graphql-java-version} </version >
5357 </dependency >
5458 <dependency >
5559 <groupId >com.graphql-java</groupId >
5660 <artifactId >graphql-java-spring-boot-starter-webmvc</artifactId >
57- <version >2.0 </version >
61+ <version >${graphql-java-spring-boot-starter-webmvc-version} </version >
5862 </dependency >
59-
6063 </dependencies >
6164
6265 <build >
Original file line number Diff line number Diff line change 1111import org .springframework .core .io .ClassPathResource ;
1212import org .springframework .core .io .Resource ;
1313import org .springframework .stereotype .Component ;
14- import org .springframework .util .ResourceUtils ;
1514import soham .spring .graphqljava .datafetcher .ProviderDataFetcher ;
1615import soham .spring .graphqljava .datafetcher .ServiceDataFetcher ;
1716
1817import javax .annotation .PostConstruct ;
19- import java .io .File ;
2018import java .io .IOException ;
21- import java .nio .file .Files ;
2219
2320import static graphql .schema .idl .TypeRuntimeWiring .newTypeWiring ;
2421
Original file line number Diff line number Diff line change 33import graphql .schema .DataFetcher ;
44import org .springframework .beans .factory .annotation .Autowired ;
55import org .springframework .stereotype .Component ;
6- import soham .spring .graphqljava .entity .Provider ;
7- import soham .spring .graphqljava .entity .Service ;
86import soham .spring .graphqljava .repository .ProviderRepository ;
9- import soham .spring .graphqljava .repository .ServiceRepository ;
107
118@ Component
129public class ProviderDataFetcher {
@@ -15,9 +12,7 @@ public class ProviderDataFetcher {
1512 ProviderRepository providerRepository ;
1613
1714 public DataFetcher getAllProviders () {
18- return dataFetchingEnvironment -> {
19- return providerRepository .findAll ();
20- };
15+ return dataFetchingEnvironment -> providerRepository .findAll ();
2116 }
2217
2318 public DataFetcher getProviderById () {
Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ public class ServiceDataFetcher {
1515
1616
1717 public DataFetcher getAllServices () {
18- return dataFetchingEnvironment -> {
19- return serviceRepository .findAll ();
20- };
18+ return dataFetchingEnvironment -> serviceRepository .findAll ();
2119 }
2220
2321 public DataFetcher getServiceById () {
You can’t perform that action at this time.
0 commit comments