Skip to content

Commit caf4d79

Browse files
authored
Merge pull request #4418 from hej090224/fix/4364-data-fetcher-result-nullability
Fix nullable bound on DataFetcherResult.newResult
2 parents 08f0b08 + 14cf4c9 commit caf4d79

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/main/java/graphql/execution/DataFetcherResult.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public String toString() {
171171
*
172172
* @return a new builder
173173
*/
174-
public static <T> Builder<T> newResult() {
174+
public static <T extends @Nullable Object> Builder<T> newResult() {
175175
return new Builder<>();
176176
}
177177

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package graphql.execution
2+
3+
class DataFetcherResultKotlinInteropTest {
4+
fun nullableNewResultFactoryCompiles(): DataFetcherResult<String?> {
5+
return DataFetcherResult.newResult<String?>()
6+
.data(null)
7+
.build()
8+
}
9+
}

0 commit comments

Comments
 (0)