package graphql.analysis;

import graphql.Internal;
import graphql.language.FragmentDefinition;
import graphql.language.Node;
import graphql.util.TraverserContext;

import java.util.Objects;

@Internal
public class QueryVisitorFragmentDefinitionEnvironmentImpl implements QueryVisitorFragmentDefinitionEnvironment {

    private final FragmentDefinition fragmentDefinition;
    private final TraverserContext<Node> traverserContext;


    public QueryVisitorFragmentDefinitionEnvironmentImpl(FragmentDefinition fragmentDefinition, TraverserContext<Node> traverserContext) {
        this.fragmentDefinition = fragmentDefinition;
        this.traverserContext = traverserContext;
    }

    @Override
    public FragmentDefinition getFragmentDefinition() {
        return fragmentDefinition;
    }

    @Override
    public TraverserContext<Node> getTraverserContext() {
        return traverserContext;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        QueryVisitorFragmentDefinitionEnvironmentImpl that = (QueryVisitorFragmentDefinitionEnvironmentImpl) o;
        return Objects.equals(fragmentDefinition, that.fragmentDefinition);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fragmentDefinition);
    }
}


@@ -1396,12 +1396,212 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        return %22QueryVisitorFragmentDefinitionEnvironmentImpl%7B%22 +%0A                %22fragmentDefinition=%22 + fragmentDefinition +%0A                '%7D';%0A    %7D
 %0A%7D%0A%0A

Add support for visiting fragments in QueryVisitior. PR feedback