@PublicApi public class MergedField extends java.lang.Object
query Foo {
bar
...BarFragment
}
fragment BarFragment on Query {
bar
}
Another example:
{
me{fistName}
me{lastName}
}
Here the me field is merged together including the sub selections.
A third example with different directives:
{
foo @someDirective
foo @anotherDirective
}
These examples make clear that you need to consider all merged fields together to have the full picture.
The actual logic when fields can successfully merged together is implemented in {#graphql.validation.rules.OverlappingFieldsCanBeMerged}Modifier and Type | Class and Description |
---|---|
static class |
MergedField.Builder |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<Argument> |
getArguments()
All merged fields share the same arguments.
|
java.util.List<Field> |
getFields()
All merged fields
|
java.lang.String |
getName()
All merged fields have the same name.
|
java.lang.String |
getResultKey()
Returns the key of this MergedField for the overall result.
|
Field |
getSingleField()
The first of the merged fields.
|
int |
hashCode() |
static MergedField.Builder |
newMergedField() |
static MergedField.Builder |
newMergedField(Field field) |
static MergedField.Builder |
newMergedField(java.util.List<Field> fields) |
java.lang.String |
toString() |
MergedField |
transform(java.util.function.Consumer<MergedField.Builder> builderConsumer) |
public java.lang.String getName()
getResultKey()
public java.lang.String getResultKey()
public Field getSingleField()
public java.util.List<Argument> getArguments()
public java.util.List<Field> getFields()
public static MergedField.Builder newMergedField()
public static MergedField.Builder newMergedField(Field field)
public static MergedField.Builder newMergedField(java.util.List<Field> fields)
public MergedField transform(java.util.function.Consumer<MergedField.Builder> builderConsumer)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object