Skip to content

Commit 928cf65

Browse files
committed
rename ExecutionPath to ResultPath
1 parent 10eeacc commit 928cf65

51 files changed

Lines changed: 226 additions & 230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/main/java/graphql/DeferredExecutionResultImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package graphql;
22

3-
import graphql.execution.ExecutionPath;
3+
import graphql.execution.ResultPath;
44

55
import java.util.Collections;
66
import java.util.LinkedHashMap;
@@ -45,7 +45,7 @@ public static class Builder {
4545
private List<Object> path = Collections.emptyList();
4646
private ExecutionResultImpl.Builder builder = ExecutionResultImpl.newExecutionResult();
4747

48-
public Builder path(ExecutionPath path) {
48+
public Builder path(ResultPath path) {
4949
this.path = assertNotNull(path).toList();
5050
return this;
5151
}

‎src/main/java/graphql/ExceptionWhileDataFetching.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package graphql;
22

33

4-
import graphql.execution.ExecutionPath;
4+
import graphql.execution.ResultPath;
55
import graphql.language.SourceLocation;
66

77
import java.util.Collections;
@@ -24,15 +24,15 @@ public class ExceptionWhileDataFetching implements GraphQLError {
2424
private final List<SourceLocation> locations;
2525
private final Map<String, Object> extensions;
2626

27-
public ExceptionWhileDataFetching(ExecutionPath path, Throwable exception, SourceLocation sourceLocation) {
27+
public ExceptionWhileDataFetching(ResultPath path, Throwable exception, SourceLocation sourceLocation) {
2828
this.path = assertNotNull(path).toList();
2929
this.exception = assertNotNull(exception);
3030
this.locations = Collections.singletonList(sourceLocation);
3131
this.extensions = mkExtensions(exception);
3232
this.message = mkMessage(path, exception);
3333
}
3434

35-
private String mkMessage(ExecutionPath path, Throwable exception) {
35+
private String mkMessage(ResultPath path, Throwable exception) {
3636
return format("Exception while fetching data (%s) : %s", path, exception.getMessage());
3737
}
3838

‎src/main/java/graphql/GraphqlErrorBuilder.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package graphql;
22

33
import graphql.execution.DataFetcherResult;
4-
import graphql.execution.ExecutionPath;
4+
import graphql.execution.ResultPath;
55
import graphql.language.SourceLocation;
66
import graphql.schema.DataFetchingEnvironment;
77

@@ -68,7 +68,7 @@ public GraphqlErrorBuilder location(SourceLocation location) {
6868
return this;
6969
}
7070

71-
public GraphqlErrorBuilder path(ExecutionPath path) {
71+
public GraphqlErrorBuilder path(ResultPath path) {
7272
this.path = assertNotNull(path).toList();
7373
return this;
7474
}

‎src/main/java/graphql/SerializationError.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package graphql;
22

33

4-
import graphql.execution.ExecutionPath;
4+
import graphql.execution.ResultPath;
55
import graphql.language.SourceLocation;
66
import graphql.schema.CoercingSerializeException;
77

@@ -18,13 +18,13 @@ public class SerializationError implements GraphQLError {
1818
private final List<Object> path;
1919
private final CoercingSerializeException exception;
2020

21-
public SerializationError(ExecutionPath path, CoercingSerializeException exception) {
21+
public SerializationError(ResultPath path, CoercingSerializeException exception) {
2222
this.path = assertNotNull(path).toList();
2323
this.exception = assertNotNull(exception);
2424
this.message = mkMessage(path, exception);
2525
}
2626

27-
private String mkMessage(ExecutionPath path, CoercingSerializeException exception) {
27+
private String mkMessage(ResultPath path, CoercingSerializeException exception) {
2828
return format("Can't serialize value (%s) : %s", path, exception.getMessage());
2929
}
3030

‎src/main/java/graphql/TypeMismatchError.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package graphql;
22

3-
import graphql.execution.ExecutionPath;
3+
import graphql.execution.ResultPath;
44
import graphql.introspection.Introspection;
55
import graphql.language.SourceLocation;
66
import graphql.schema.GraphQLEnumType;
@@ -27,13 +27,13 @@ public class TypeMismatchError implements GraphQLError {
2727
private final List<Object> path;
2828
private final GraphQLType expectedType;
2929

30-
public TypeMismatchError(ExecutionPath path, GraphQLType expectedType) {
30+
public TypeMismatchError(ResultPath path, GraphQLType expectedType) {
3131
this.path = assertNotNull(path).toList();
3232
this.expectedType = assertNotNull(expectedType);
3333
this.message = mkMessage(path, expectedType);
3434
}
3535

36-
private String mkMessage(ExecutionPath path, GraphQLType expectedType) {
36+
private String mkMessage(ResultPath path, GraphQLType expectedType) {
3737
String expectedTypeKind = GraphQLTypeToTypeKindMapping.getTypeKindFromGraphQLType(expectedType).name();
3838
return format("Can't resolve value (%s) : type mismatch error, expected type %s", path, expectedTypeKind);
3939
}

‎src/main/java/graphql/UnresolvedTypeError.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package graphql;
22

3-
import graphql.execution.ExecutionPath;
43
import graphql.execution.ExecutionStepInfo;
4+
import graphql.execution.ResultPath;
55
import graphql.execution.UnresolvedTypeException;
66
import graphql.language.SourceLocation;
77

@@ -18,14 +18,14 @@ public class UnresolvedTypeError implements GraphQLError {
1818
private final List<Object> path;
1919
private final UnresolvedTypeException exception;
2020

21-
public UnresolvedTypeError(ExecutionPath path, ExecutionStepInfo info,
21+
public UnresolvedTypeError(ResultPath path, ExecutionStepInfo info,
2222
UnresolvedTypeException exception) {
2323
this.path = assertNotNull(path).toList();
2424
this.exception = assertNotNull(exception);
2525
this.message = mkMessage(path, exception, assertNotNull(info));
2626
}
2727

28-
private String mkMessage(ExecutionPath path, UnresolvedTypeException exception, ExecutionStepInfo info) {
28+
private String mkMessage(ResultPath path, UnresolvedTypeException exception, ExecutionStepInfo info) {
2929
return format("Can't resolve '%s'. Abstract type '%s' must resolve to an Object type at runtime for field '%s.%s'. %s",
3030
path,
3131
exception.getInterfaceOrUnionType().getName(),

‎src/main/java/graphql/cachecontrol/CacheControl.java‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
import graphql.ExecutionResult;
44
import graphql.ExecutionResultImpl;
55
import graphql.PublicApi;
6-
import graphql.execution.ExecutionPath;
6+
import graphql.execution.ResultPath;
77
import graphql.schema.DataFetchingEnvironment;
88

9-
import java.util.ArrayList;
10-
import java.util.Collections;
119
import java.util.LinkedHashMap;
1210
import java.util.List;
1311
import java.util.Map;
@@ -82,7 +80,7 @@ private CacheControl() {
8280
*
8381
* @return this object builder style
8482
*/
85-
public CacheControl hint(ExecutionPath path, Integer maxAge, Scope scope) {
83+
public CacheControl hint(ResultPath path, Integer maxAge, Scope scope) {
8684
assertNotNull(path);
8785
assertNotNull(scope);
8886
hints.add(new Hint(path.toList(), maxAge, scope));
@@ -97,7 +95,7 @@ public CacheControl hint(ExecutionPath path, Integer maxAge, Scope scope) {
9795
*
9896
* @return this object builder style
9997
*/
100-
public CacheControl hint(ExecutionPath path, Scope scope) {
98+
public CacheControl hint(ResultPath path, Scope scope) {
10199
return hint(path, null, scope);
102100
}
103101

@@ -109,7 +107,7 @@ public CacheControl hint(ExecutionPath path, Scope scope) {
109107
*
110108
* @return this object builder style
111109
*/
112-
public CacheControl hint(ExecutionPath path, Integer maxAge) {
110+
public CacheControl hint(ResultPath path, Integer maxAge) {
113111
return hint(path, maxAge, Scope.PUBLIC);
114112
}
115113

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public AbsoluteGraphQLError(ExecutionStrategyParameters executionStrategyParamet
4343
}
4444
}
4545

46-
public AbsoluteGraphQLError(MergedField sameField, ExecutionPath executionPath, GraphQLError relativeError) {
47-
this.absolutePath = createAbsolutePath(executionPath, relativeError);
46+
public AbsoluteGraphQLError(MergedField sameField, ResultPath resultPath, GraphQLError relativeError) {
47+
this.absolutePath = createAbsolutePath(resultPath, relativeError);
4848
this.locations = createAbsoluteLocations(relativeError, sameField);
4949
this.message = relativeError.getMessage();
5050
this.errorType = relativeError.getErrorType();
@@ -91,17 +91,17 @@ public Map<String, Object> getExtensions() {
9191
*
9292
* @return List of paths from the root.
9393
*/
94-
private List<Object> createAbsolutePath(ExecutionPath executionPath,
94+
private List<Object> createAbsolutePath(ResultPath resultPath,
9595
GraphQLError relativeError) {
9696
return Optional.ofNullable(relativeError.getPath())
9797
.map(originalPath -> {
9898
List<Object> path = new ArrayList<>();
99-
path.addAll(executionPath.toList());
99+
path.addAll(resultPath.toList());
100100
path.addAll(relativeError.getPath());
101101
return path;
102102
})
103103
.map(Collections::unmodifiableList)
104-
.orElse(executionPath.toList());
104+
.orElse(resultPath.toList());
105105
}
106106

107107
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public CompletableFuture<ExecutionResult> execute(ExecutionContext executionCont
6060
for (String fieldName : fieldNames) {
6161
MergedField currentField = fields.getSubField(fieldName);
6262

63-
ExecutionPath fieldPath = parameters.getPath().segment(mkNameForPath(currentField));
63+
ResultPath fieldPath = parameters.getPath().segment(mkNameForPath(currentField));
6464
ExecutionStrategyParameters newParameters = parameters
6565
.transform(builder -> builder.field(currentField).path(fieldPath).parent(parameters));
6666

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public CompletableFuture<ExecutionResult> execute(ExecutionContext executionCont
3535

3636
CompletableFuture<List<ExecutionResult>> resultsFuture = Async.eachSequentially(fieldNames, (fieldName, index, prevResults) -> {
3737
MergedField currentField = fields.getSubField(fieldName);
38-
ExecutionPath fieldPath = parameters.getPath().segment(mkNameForPath(currentField));
38+
ResultPath fieldPath = parameters.getPath().segment(mkNameForPath(currentField));
3939
ExecutionStrategyParameters newParameters = parameters
4040
.transform(builder -> builder.field(currentField).path(fieldPath));
4141
return resolveField(executionContext, newParameters);

0 commit comments

Comments
 (0)