Skip to content

Commit

Permalink
Fix ConcurrentModificationException in federation fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Lovakov authored and jmartisk committed Sep 16, 2024
1 parent eb2b6db commit b0eb3f2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -39,7 +40,7 @@ public class FederationDataFetcher implements DataFetcher<CompletableFuture<List
public static final String TYPENAME = "__typename";
private final GraphQLObjectType queryType;
private final GraphQLCodeRegistry codeRegistry;
private final HashMap<TypeAndArgumentNames, TypeFieldWrapper> cache = new HashMap<>();
private final ConcurrentHashMap<TypeAndArgumentNames, TypeFieldWrapper> cache = new ConcurrentHashMap<>();

public FederationDataFetcher(GraphQLObjectType queryType, GraphQLCodeRegistry codeRegistry) {
this.queryType = queryType;
Expand Down

0 comments on commit b0eb3f2

Please sign in to comment.