Skip to content

Commit d04517c

Browse files
committed
Locale is now in DFE - no need for reflection
1 parent e1bcdaa commit d04517c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main/java/graphql/validation/locale/LocaleUtil.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,13 @@ public static Locale determineLocale(DataFetchingEnvironment environment, Locale
2727
//
2828
Locale locale = environment.getLocale();
2929
if (locale == null) {
30-
locale = extractLocale(environment);
30+
locale = extractLocale(environment.getContext());
3131
if (locale == null) {
32-
locale = extractLocale(environment.getContext());
32+
locale = extractLocale(environment.getSource());
3333
if (locale == null) {
34-
locale = extractLocale(environment.getSource());
34+
locale = extractLocale(environment.getRoot());
3535
if (locale == null) {
36-
locale = extractLocale(environment.getRoot());
37-
if (locale == null) {
38-
locale = defaultLocale;
39-
}
36+
locale = defaultLocale;
4037
}
4138
}
4239
}

0 commit comments

Comments
 (0)