Skip to content

Commit

Permalink
Merge pull request #389 from Netflix/reactive-return-types
Browse files Browse the repository at this point in the history
Support returning Mono/Flux from data fetchers
  • Loading branch information
paulbakker committed Jun 8, 2021
2 parents 6fea279 + 395c0a4 commit 789e883
Show file tree
Hide file tree
Showing 28 changed files with 512 additions and 125 deletions.
12 changes: 6 additions & 6 deletions graphql-dgs-client/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"locked": "16.2"
},
"com.jayway.jsonpath:json-path": {
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs-platform": {
"project": true
Expand Down Expand Up @@ -227,7 +227,7 @@
"locked": "16.2"
},
"com.jayway.jsonpath:json-path": {
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs-platform": {
"project": true
Expand Down Expand Up @@ -294,13 +294,13 @@
"locked": "16.2"
},
"com.jayway.jsonpath:json-path": {
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs-platform": {
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"locked": "3.4.6"
Expand Down Expand Up @@ -356,13 +356,13 @@
"locked": "16.2"
},
"com.jayway.jsonpath:json-path": {
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs-platform": {
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"locked": "3.4.6"
Expand Down
12 changes: 6 additions & 6 deletions graphql-dgs-example-java-webflux/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -358,7 +358,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -572,7 +572,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -649,7 +649,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -750,7 +750,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -828,7 +828,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"firstLevelTransitive": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2021 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.graphql.dgs.example.reactive.datafetchers;

import com.netflix.graphql.dgs.DgsComponent;
import com.netflix.graphql.dgs.DgsQuery;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@DgsComponent
public class ReactiveDataFetchers {
@DgsQuery
public Mono<String> mono() {
return Mono.just("hello mono");
}

@DgsQuery
public Flux<Integer> flux() {
return Flux.just(1, 2, 3);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extend type Query {
mono: String
flux: [Int]
}
12 changes: 6 additions & 6 deletions graphql-dgs-example-java/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -354,7 +354,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -603,7 +603,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -677,7 +677,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -777,7 +777,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -861,7 +861,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"firstLevelTransitive": [
Expand Down
12 changes: 6 additions & 6 deletions graphql-dgs-example-shared/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -296,7 +296,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -440,7 +440,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -482,7 +482,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"locked": "3.4.6"
Expand Down Expand Up @@ -563,7 +563,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -605,7 +605,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"locked": "3.4.6"
Expand Down
12 changes: 6 additions & 6 deletions graphql-dgs-extended-scalars/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"project": true
Expand Down Expand Up @@ -277,7 +277,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"project": true
Expand Down Expand Up @@ -399,7 +399,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -464,7 +464,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -561,7 +561,7 @@
"com.netflix.graphql.dgs:graphql-dgs",
"com.netflix.graphql.dgs:graphql-dgs-client"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -626,7 +626,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-core": {
"firstLevelTransitive": [
Expand Down
4 changes: 2 additions & 2 deletions graphql-dgs-mocking/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"org.jetbrains.kotlin:kotlin-bom": {
"locked": "1.4.32"
Expand Down Expand Up @@ -308,7 +308,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"org.jetbrains.kotlin:kotlin-bom": {
"locked": "1.4.32"
Expand Down
12 changes: 6 additions & 6 deletions graphql-dgs-reactive/dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"project": true
Expand Down Expand Up @@ -277,7 +277,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"project": true
Expand Down Expand Up @@ -395,7 +395,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -437,7 +437,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-test": {
"locked": "3.4.6"
Expand Down Expand Up @@ -518,7 +518,7 @@
"firstLevelTransitive": [
"com.netflix.graphql.dgs:graphql-dgs"
],
"locked": "2.5.0"
"locked": "2.6.0"
},
"com.netflix.graphql.dgs:graphql-dgs": {
"firstLevelTransitive": [
Expand Down Expand Up @@ -560,7 +560,7 @@
"project": true
},
"io.mockk:mockk": {
"locked": "1.10.3-jdk8"
"locked": "1.11.0"
},
"io.projectreactor:reactor-test": {
"locked": "3.4.6"
Expand Down

0 comments on commit 789e883

Please sign in to comment.