A Pen by Sven Hakoort on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demographql.query | |
import com.expediagroup.graphql.spring.operations.Query | |
import org.springframework.stereotype.Controller | |
@Controller | |
class DemoQuery: Query { | |
fun demo(): String { | |
return "Our query works" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demographql.model | |
import com.expediagroup.graphql.annotations.GraphQLID | |
import org.springframework.data.annotation.Id | |
import java.util.* | |
data class Demo( | |
val someText: String | |
) { | |
@GraphQLID @Id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demographql.service | |
import com.example.demographql.model.Demo | |
import com.example.demographql.repository.DemoRepository | |
import org.springframework.stereotype.Service | |
import reactor.core.publisher.Mono | |
@Service | |
class DemoService(val demoRepository: DemoRepository) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demographql.mutation | |
import com.example.demographql.model.Demo | |
import com.example.demographql.service.DemoService | |
import com.expediagroup.graphql.spring.operations.Mutation | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.stereotype.Controller | |
import reactor.core.publisher.Mono | |
@Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demographql.config | |
import com.expediagroup.graphql.execution.FunctionDataFetcher | |
import graphql.schema.DataFetchingEnvironment | |
import reactor.core.publisher.Flux | |
import reactor.core.publisher.Mono | |
import kotlin.reflect.KFunction | |
class CustomFunctionDataFetcher(target: Any?, fn: KFunction<*>) : FunctionDataFetcher(target, fn) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demographql.query | |
import com.example.demographql.model.Demo | |
import com.example.demographql.service.DemoService | |
import com.expediagroup.graphql.spring.operations.Query | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.stereotype.Controller | |
import reactor.core.publisher.Mono | |
@Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
profiles: default | |
data.mongodb: | |
host: localhost:27017 | |
database: demo | |
graphql: | |
packages: "com.example.demographql" |