public class DataFetchingFieldSelectionSetImpl extends java.lang.Object implements DataFetchingFieldSelectionSet
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String fieldGlobPattern)
This will return true if the field selection set matches a specified "glob" pattern matching ie
the glob pattern matching supported by
FileSystem.getPathMatcher(java.lang.String) . |
boolean |
containsAllOf(java.lang.String fieldGlobPattern,
java.lang.String... fieldGlobPatterns)
This will return true if the field selection set matches all of the specified "glob" pattern matches ie
the glob pattern matching supported by
FileSystem.getPathMatcher(java.lang.String) . |
boolean |
containsAnyOf(java.lang.String fieldGlobPattern,
java.lang.String... fieldGlobPatterns)
This will return true if the field selection set matches any of the specified "glob" pattern matches ie
the glob pattern matching supported by
FileSystem.getPathMatcher(java.lang.String) . |
java.util.List<SelectedField> |
getFields()
This will return all selected fields.
|
java.util.List<SelectedField> |
getFields(java.lang.String fieldGlobPattern,
java.lang.String... fieldGlobPatterns)
This will return a list of selected fields that match a specified "glob" pattern matching ie
the glob pattern matching supported by
FileSystem.getPathMatcher(java.lang.String) . |
java.util.Map<java.lang.String,java.util.List<SelectedField>> |
getFieldsGroupedByResultKey()
The result key of a selected field represents what the graphql return value will be.
|
java.util.Map<java.lang.String,java.util.List<SelectedField>> |
getFieldsGroupedByResultKey(java.lang.String fieldGlobPattern,
java.lang.String... fieldGlobPatterns)
The result key of a selected field represents what the graphql return value will be.
|
java.util.List<SelectedField> |
getImmediateFields()
This will return all selected fields that are immediate child fields
of the field being fetched.
|
static DataFetchingFieldSelectionSet |
newCollector(GraphQLSchema schema,
GraphQLOutputType fieldType,
java.util.function.Supplier<ExecutableNormalizedField> normalizedFieldSupplier) |
java.lang.String |
toString() |
public static DataFetchingFieldSelectionSet newCollector(GraphQLSchema schema, GraphQLOutputType fieldType, java.util.function.Supplier<ExecutableNormalizedField> normalizedFieldSupplier)
public boolean contains(java.lang.String fieldGlobPattern)
DataFetchingFieldSelectionSet
FileSystem.getPathMatcher(java.lang.String)
.
This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.
contains
in interface DataFetchingFieldSelectionSet
fieldGlobPattern
- the glob pattern to match fields againstFileSystem.getPathMatcher(String)
public boolean containsAnyOf(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
DataFetchingFieldSelectionSet
FileSystem.getPathMatcher(java.lang.String)
.
This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.
containsAnyOf
in interface DataFetchingFieldSelectionSet
fieldGlobPattern
- the glob pattern to match fields againstfieldGlobPatterns
- optionally more glob pattern to match fields againstFileSystem.getPathMatcher(String)
public boolean containsAllOf(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
DataFetchingFieldSelectionSet
FileSystem.getPathMatcher(java.lang.String)
.
This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.
containsAllOf
in interface DataFetchingFieldSelectionSet
fieldGlobPattern
- the glob pattern to match fields againstfieldGlobPatterns
- optionally more glob pattern to match fields againstFileSystem.getPathMatcher(String)
public java.util.List<SelectedField> getFields(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
DataFetchingFieldSelectionSet
FileSystem.getPathMatcher(java.lang.String)
.
This will allow you to use '*', '**' and '?' as special matching characters such that "invoice/customer*" would match an invoice field with child fields that start with 'customer'.
The fields are guaranteed to be in pre-order as they appear in the query.
A selected field may have an alias - and hence is a unique field in the returned list. It may have the same field names as others in the list but when you also consider the alias then it is indeed unique because it would be another entry in the graphql result.
getFields
in interface DataFetchingFieldSelectionSet
fieldGlobPattern
- the glob pattern to match fields againstfieldGlobPatterns
- optionally more glob pattern to match fields againstpublic java.util.List<SelectedField> getFields()
DataFetchingFieldSelectionSet
The fields are guaranteed to be in pre-order as they appear in the query.
A selected field may have an alias - and hence is a unique field in the returned list. It may have the same field names as others in the list but when you also consider the alias then it is indeed unique because it would be another entry in the graphql result.
getFields
in interface DataFetchingFieldSelectionSet
public java.util.List<SelectedField> getImmediateFields()
DataFetchingFieldSelectionSet
The fields are guaranteed to be in pre-order as they appear in the query.
A selected field may have an alias - and hence is a unique field in the returned list. It may have the same field names as others in the list but when you also consider the alias then it is indeed unique because it would be another entry in the graphql result.
getImmediateFields
in interface DataFetchingFieldSelectionSet
public java.util.Map<java.lang.String,java.util.List<SelectedField>> getFieldsGroupedByResultKey()
DataFetchingFieldSelectionSet
GraphQLFieldDefinition
may lead to a field being asked for multiple times (with differing arguments) if field aliases are used. This method
helps you get all possible field invocations grouped by their result key. The arguments are guaranteed to be the same if
the result key is the same, otherwise the query would not have validated correctly.getFieldsGroupedByResultKey
in interface DataFetchingFieldSelectionSet
public java.util.Map<java.lang.String,java.util.List<SelectedField>> getFieldsGroupedByResultKey(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
DataFetchingFieldSelectionSet
GraphQLFieldDefinition
may lead to a field being asked for multiple times (with differing arguments) if field aliases are used. This method
helps you get all possible field invocations grouped by their result key. The arguments are guaranteed to be the same if
the result key is the same, otherwise the query would not have validated correctly.getFieldsGroupedByResultKey
in interface DataFetchingFieldSelectionSet
fieldGlobPattern
- the glob pattern to match fields againstfieldGlobPatterns
- optionally more glob pattern to match fields againstpublic java.lang.String toString()
toString
in class java.lang.Object