Skip to content

Commit 56db226

Browse files
committed
rename getUnmodified parent to getFieldsContainer
1 parent 2c4ff9a commit 56db226

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/main/java/graphql/analysis/MaxQueryComplexityInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private FieldComplexityEnvironment convertEnv(QueryVisitorFieldEnvironment query
108108
return new FieldComplexityEnvironment(
109109
queryVisitorFieldEnvironment.getField(),
110110
queryVisitorFieldEnvironment.getFieldDefinition(),
111-
queryVisitorFieldEnvironment.getUnmodifiedParentType(),
111+
queryVisitorFieldEnvironment.getFieldsContainer(),
112112
queryVisitorFieldEnvironment.getArguments(),
113113
parentEnv
114114
);

src/main/java/graphql/analysis/QueryVisitorFieldEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface QueryVisitorFieldEnvironment {
3434
*
3535
* @throws IllegalStateException if the current field is __typename see {@link #isTypeNameIntrospectionField()}
3636
*/
37-
GraphQLFieldsContainer getUnmodifiedParentType();
37+
GraphQLFieldsContainer getFieldsContainer();
3838

3939
QueryVisitorFieldEnvironment getParentEnvironment();
4040

src/main/java/graphql/analysis/QueryVisitorFieldEnvironmentImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public SelectionSetContainer getSelectionSetContainer() {
7171
}
7272

7373
@Override
74-
public GraphQLFieldsContainer getUnmodifiedParentType() {
74+
public GraphQLFieldsContainer getFieldsContainer() {
7575
if (isTypeNameIntrospectionField()) {
7676
throw new IllegalStateException("introspection field __typename doesn't have a fields container");
7777
}

src/main/java/graphql/execution/instrumentation/fieldvalidation/FieldValidationSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public GraphQLFieldDefinition getFieldDefinition() {
106106

107107
@Override
108108
public GraphQLCompositeType getParentType() {
109-
return traversalEnv.getUnmodifiedParentType();
109+
return traversalEnv.getFieldsContainer();
110110
}
111111

112112
@Override

src/test/groovy/graphql/analysis/QueryTraversalTest.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class QueryTraversalTest extends Specification {
467467
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "bar" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Query" })
468468
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it ->
469469
it.field.name == "subFoo" && it.fieldDefinition.type.name == "String" &&
470-
it.unmodifiedParentType.name == "Foo" &&
470+
it.fieldsContainer.name == "Foo" &&
471471
(it.parentType instanceof GraphQLNonNull) &&
472472
it.parentEnvironment.field.name == "foo" && it.parentEnvironment.fieldDefinition.type.wrappedType.name == "Foo"
473473
})
@@ -999,8 +999,8 @@ class QueryTraversalTest extends Specification {
999999
10001000
then:
10011001
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "foo" && it.fieldDefinition.type.name == "CatOrDog" && it.parentType.name == "Query" })
1002-
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "catName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Cat" && it.unmodifiedParentType.name == "Cat" })
1003-
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "dogName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Dog" && it.unmodifiedParentType.name == "Dog" })
1002+
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "catName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Cat" && it.fieldsContainer.name == "Cat" })
1003+
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "dogName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Dog" && it.fieldsContainer.name == "Dog" })
10041004
10051005
where:
10061006
order | visitFn
@@ -1045,9 +1045,9 @@ class QueryTraversalTest extends Specification {
10451045
10461046
then:
10471047
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "foo" && it.fieldDefinition.type == list(nonNull(catOrDog)) && it.parentType.name == "Query" })
1048-
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "catName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Cat" && it.unmodifiedParentType.name == "Cat" })
1049-
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "dogName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Dog" && it.unmodifiedParentType.name == "Dog" })
1050-
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "id" && it.fieldDefinition.type.name == "String" && it.parentType == nonNull(list(nonNull(bar))) && it.unmodifiedParentType.name == "Bar" })
1048+
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "catName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Cat" && it.fieldsContainer.name == "Cat" })
1049+
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "dogName" && it.fieldDefinition.type.name == "String" && it.parentType.name == "Dog" && it.fieldsContainer.name == "Dog" })
1050+
1 * visitor.visitField({ QueryVisitorFieldEnvironmentImpl it -> it.field.name == "id" && it.fieldDefinition.type.name == "String" && it.parentType == nonNull(list(nonNull(bar))) && it.fieldsContainer.name == "Bar" })
10511051
10521052
where:
10531053
order | visitFn
@@ -1237,7 +1237,7 @@ class QueryTraversalTest extends Specification {
12371237
when:
12381238
queryTraversal.visitPreOrder(visitor)
12391239
env.typeNameIntrospectionField
1240-
env.getUnmodifiedParentType()
1240+
env.getFieldsContainer()
12411241
12421242
then:
12431243
thrown(IllegalStateException)

0 commit comments

Comments
 (0)