Skip to content

Commit 53bdc11

Browse files
committed
Makes the property name a public getter
1 parent 0409bad commit 53bdc11

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/graphql/schema/PropertyDataFetcher.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class PropertyDataFetcher<T> implements DataFetcher<T> {
5252
* @param propertyName the name of the property to retrieve
5353
*/
5454
public PropertyDataFetcher(String propertyName) {
55-
this.propertyName = propertyName;
55+
this.propertyName = Assert.assertNotNull(propertyName);
5656
this.function = null;
5757
}
5858

@@ -109,6 +109,12 @@ public static <T, O> PropertyDataFetcher<T> fetching(Function<O, T> function) {
109109
return new PropertyDataFetcher<>(function);
110110
}
111111

112+
/**
113+
* @return the property that this is fetching for
114+
*/
115+
public String getPropertyName() {
116+
return propertyName;
117+
}
112118

113119
@SuppressWarnings("unchecked")
114120
@Override

0 commit comments

Comments
 (0)