graphql.nadel.normalized.NormalizedQueryFromAst Maven / Gradle / Ivy
package graphql.nadel.normalized;
import graphql.Internal;
import graphql.execution.MergedField;
import graphql.nadel.dsl.NodeId;
import java.util.List;
import java.util.Map;
@Internal
public class NormalizedQueryFromAst {
private final List topLevelFields;
private final Map> normalizedFieldsByFieldId;
private final Map mergedFieldByNormalizedFields;
public NormalizedQueryFromAst(List topLevelFields,
Map> normalizedFieldsByFieldId,
Map mergedFieldByNormalizedFields) {
this.topLevelFields = topLevelFields;
this.normalizedFieldsByFieldId = normalizedFieldsByFieldId;
this.mergedFieldByNormalizedFields = mergedFieldByNormalizedFields;
}
public List getTopLevelFields() {
return topLevelFields;
}
public Map> getNormalizedFieldsByFieldId() {
return normalizedFieldsByFieldId;
}
public List getNormalizedFieldsByFieldId(String astFieldId) {
return normalizedFieldsByFieldId.get(astFieldId);
}
public Map getMergedFieldByNormalizedFields() {
return mergedFieldByNormalizedFields;
}
public List getFieldIds(NormalizedQueryField normalizedQueryField) {
MergedField mergedField = mergedFieldByNormalizedFields.get(normalizedQueryField);
return NodeId.getIds(mergedField);
}
}