@PublicApi public interface DataFetchingFieldSelectionSet extends java.util.function.Supplier<MergedSelectionSet>
DataFetcher
was invoked.
For example imagine we are fetching the field 'user' in the following query
{
user {
name
age
weight
friends {
name
}
}
}
The selection set in the case above consists of the fields "name, age, weight, friends and friends/name".
You can use this selection set perhaps to "peek" ahead and decide that field values you might need
from the underlying data system. Imagine a SQL system where this might represent the SQL 'projection'
of columns say.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) . |
MergedSelectionSet |
get() |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
getArguments() |
java.util.Map<java.lang.String,GraphQLFieldDefinition> |
getDefinitions() |
SelectedField |
getField(java.lang.String fqFieldName)
This will return a selected field using the fully qualified field name.
|
java.util.List<SelectedField> |
getFields()
This will return all selected fields.
|
java.util.List<SelectedField> |
getFields(java.lang.String fieldGlobPattern)
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) . |
MergedSelectionSet get()
get
in interface java.util.function.Supplier<MergedSelectionSet>
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getArguments()
java.util.Map<java.lang.String,GraphQLFieldDefinition> getDefinitions()
GraphQLFieldDefinition
s for each field in the selection setboolean contains(java.lang.String fieldGlobPattern)
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'.fieldGlobPattern
- the glob pattern to match fields againstFileSystem.getPathMatcher(String)
boolean containsAnyOf(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
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'.fieldGlobPattern
- the glob pattern to match fields againstfieldGlobPatterns
- optionally more glob pattern to match fields againstFileSystem.getPathMatcher(String)
boolean containsAllOf(java.lang.String fieldGlobPattern, java.lang.String... fieldGlobPatterns)
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'.fieldGlobPattern
- the glob pattern to match fields againstfieldGlobPatterns
- optionally more glob pattern to match fields againstFileSystem.getPathMatcher(String)
java.util.List<SelectedField> getFields()
java.util.List<SelectedField> getFields(java.lang.String fieldGlobPattern)
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.fieldGlobPattern
- the glob pattern to match fields againstSelectedField getField(java.lang.String fqFieldName)
fqFieldName
- the fully qualified name that is contained in the map from get()