Task: Upgraded the dgs graphql to submodules and parent modules for extends projects
This commit is contained in:
parent
83477a9946
commit
32f356569d
26
.gitignore
vendored
26
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
HELP.md
|
||||
../HELP.md
|
||||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
@ -35,3 +35,27 @@ out/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
@ -1,58 +1,45 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("org.springframework.boot") version "2.5.3"
|
||||
id("io.spring.dependency-management") version "1.0.11.RELEASE"
|
||||
kotlin("jvm") version "1.5.21"
|
||||
kotlin("plugin.spring") version "1.5.21"
|
||||
kotlin("plugin.jpa") version "1.5.21"
|
||||
id("com.netflix.dgs.codegen") version "5.0.5"
|
||||
id("org.springframework.boot") version "2.5.3" apply false
|
||||
id("io.spring.dependency-management") version "1.0.11.RELEASE" apply false
|
||||
kotlin("jvm") version "1.5.21" apply false
|
||||
kotlin("plugin.spring") version "1.5.21" apply false
|
||||
kotlin("plugin.jpa") version "1.5.21" apply false
|
||||
id("com.netflix.dgs.codegen") version "5.0.5" apply false
|
||||
}
|
||||
|
||||
group = "com.cubetiqs"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
java.sourceCompatibility = JavaVersion.VERSION_11
|
||||
allprojects {
|
||||
repositories {
|
||||
maven { url = uri("https://m.ctdn.net") }
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url = uri("https://m.ctdn.net") }
|
||||
group = "com.cubetiqs"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
|
||||
val javaVersion = "11"
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = javaVersion
|
||||
targetCompatibility = javaVersion
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||
jvmTarget = javaVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extra["dgsVersion"] = "4.5.0"
|
||||
subprojects {
|
||||
apply {
|
||||
plugin("io.spring.dependency-management")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:${property("dgsVersion")}")
|
||||
runtimeOnly("com.netflix.graphql.dgs:graphql-dgs-subscriptions-websockets-autoconfigure:${property("dgsVersion")}")
|
||||
|
||||
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-webflux")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
|
||||
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("io.projectreactor:reactor-test")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf("-Xjsr305=strict")
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
|
||||
packageName = "com.cubetiqs.graphql.demo.dgmodel"
|
||||
schemaPaths = mutableListOf("${projectDir}/src/main/resources/schema")
|
||||
generateClient = true
|
||||
the<io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension>().apply {
|
||||
imports {
|
||||
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
||||
}
|
||||
}
|
||||
}
|
37
dgs-graphql/.gitignore
vendored
Normal file
37
dgs-graphql/.gitignore
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
../HELP.md
|
||||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
44
dgs-graphql/build.gradle.kts
Normal file
44
dgs-graphql/build.gradle.kts
Normal file
@ -0,0 +1,44 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("org.springframework.boot")
|
||||
id("io.spring.dependency-management")
|
||||
kotlin("jvm")
|
||||
kotlin("plugin.spring")
|
||||
kotlin("plugin.jpa")
|
||||
id("com.netflix.dgs.codegen")
|
||||
}
|
||||
|
||||
extra["dgsVersion"] = "4.5.0"
|
||||
|
||||
dependencies {
|
||||
implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:${property("dgsVersion")}")
|
||||
runtimeOnly("com.netflix.graphql.dgs:graphql-dgs-subscriptions-websockets-autoconfigure:${property("dgsVersion")}")
|
||||
|
||||
implementation("org.springframework.boot:spring-boot-starter-security")
|
||||
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.springframework.boot:spring-boot-starter-webflux")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
|
||||
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
|
||||
|
||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation("io.projectreactor:reactor-test")
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
|
||||
packageName = "com.cubetiqs.graphql.demo.dgmodel"
|
||||
schemaPaths = mutableListOf("${projectDir}/src/main/resources/schema")
|
||||
generateClient = true
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.cubetiqs.graphql.demo.config
|
||||
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
|
||||
import org.springframework.security.config.http.SessionCreationPolicy
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||
class WebSecurityConfig : WebSecurityConfigurerAdapter() {
|
||||
override fun configure(http: HttpSecurity) {
|
||||
http.csrf().disable()
|
||||
.sessionManagement()
|
||||
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
.and()
|
||||
.authorizeRequests()
|
||||
.anyRequest()
|
||||
.permitAll()
|
||||
}
|
||||
}
|
@ -7,7 +7,6 @@ import com.cubetiqs.graphql.demo.domain.account.AccountInput
|
||||
import com.cubetiqs.graphql.demo.domain.account.AccountMapper
|
||||
import com.cubetiqs.graphql.demo.repository.AccountRepository
|
||||
import com.cubetiqs.graphql.demo.repository.UserRepository
|
||||
import com.netflix.graphql.dgs.DgsData
|
||||
import com.netflix.graphql.dgs.DgsMutation
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.transaction.annotation.Propagation
|
@ -1,7 +1,9 @@
|
||||
package com.cubetiqs.graphql.demo.resolver.query
|
||||
|
||||
import com.cubetiqs.graphql.demo.context.GQuery
|
||||
import com.cubetiqs.graphql.demo.dgmodel.DgsConstants
|
||||
import com.netflix.graphql.dgs.DgsQuery
|
||||
import org.springframework.security.access.prepost.PreAuthorize
|
||||
import reactor.core.publisher.Mono
|
||||
import java.util.concurrent.CompletableFuture
|
||||
|
||||
@ -12,7 +14,8 @@ class HelloQueryResolver {
|
||||
return Mono.just("Hello Query...!").toFuture()
|
||||
}
|
||||
|
||||
@DgsQuery(field = "helloByName")
|
||||
@PreAuthorize("hasAnyRole('ADMIN')")
|
||||
@DgsQuery(field = DgsConstants.QUERY.HelloByName)
|
||||
fun helloByName(name: String): CompletableFuture<String> {
|
||||
return Mono.just("Hello $name...!").toFuture()
|
||||
}
|
@ -1,8 +1,3 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
maven { url = uri("https://repo.spring.io/snapshot") }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
rootProject.name = "graphql-demo"
|
||||
|
||||
include("dgs-graphql")
|
Loading…
Reference in New Issue
Block a user