public interface DataFetchingFieldSelectionSet extends 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(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) . |
MergedSelectionSet |
get() |
Map<String,Map<String,Object>> |
getArguments() |
Map<String,GraphQLFieldDefinition> |
getDefinitions() |
SelectedField |
getField(String fqFieldName)
This will return a selected field using the fully qualified field name.
|
List<SelectedField> |
getFields()
This will return all selected fields.
|
List<SelectedField> |
getFields(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 Supplier<MergedSelectionSet>
Map<String,Map<String,Object>> getArguments()
Map<String,GraphQLFieldDefinition> getDefinitions()
GraphQLFieldDefinition
s for each field in the selection setboolean contains(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)
List<SelectedField> getFields()
List<SelectedField> getFields(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 againstSelectedField getField(String fqFieldName)
fqFieldName
- the fully qualified name that is contained in the map from get()
Copyright © 2019. All rights reserved.