I'm trying to run simplest graphql example. I created application with spring initializer and only added graphql dependencies. My build.gradle
buildscript {
ext {
springBootVersion = '2.1.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation('org.springframework.boot:spring-boot-starter-web')
testImplementation('org.springframework.boot:spring-boot-starter-test')
compile 'com.graphql-java-kickstart:graphql-spring-boot-starter:5.3.1'
compile 'com.graphql-java-kickstart:graphiql-spring-boot-starter:5.3.1'
compile 'com.graphql-java-kickstart:voyager-spring-boot-starter:5.3.1'
}
DemoApplication.java
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
When I run the project and hit the endpoint /graphql
it returns 404
. What is missing in my configuration?
/graphql
automatically? I see it's in your deps, but there's no further config regarding graphql api. – Preordain