Skip to content

Commit f0d288c

Browse files
jmccaullbbakerman
authored andcommitted
update path to not be null and test to match (graphql-java#1526)
1 parent 9616132 commit f0d288c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/graphql/execution/AbsoluteGraphQLError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private List<Object> createAbsolutePath(ExecutionPath executionPath,
101101
return path;
102102
})
103103
.map(Collections::unmodifiableList)
104-
.orElse(null);
104+
.orElse(executionPath.toList());
105105
}
106106

107107
/**

src/test/groovy/graphql/execution/AbsoluteGraphQLErrorTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class AbsoluteGraphQLErrorTest extends Specification {
5858
error.getExtensions() == ["ext": true]
5959
}
6060

61-
def "constructor handles missing path as null"() {
61+
def "constructor handles missing path"() {
6262
given:
6363

6464
def field = Field.newField().name("test").sourceLocation(new SourceLocation(4, 5)).build()
@@ -79,7 +79,7 @@ class AbsoluteGraphQLErrorTest extends Specification {
7979

8080
then:
8181

82-
error.getPath() == null
82+
error.getPath() == ExecutionPath.fromList(["foo", "bar"]).toList()
8383
}
8484

8585
def "when constructor receives empty path it should return the base field path"() {

0 commit comments

Comments
 (0)