Package graphql.execution.directives
Interface QueryDirectives
-
- All Known Implementing Classes:
QueryDirectivesImpl
@PublicApi public interface QueryDirectives
This gives you access to the immediate directives on aMergedField
. This does not include directives on parent fields or fragment containers.Because a
MergedField
can actually have multiple fields and hence directives on each field instance its possible that there is more than one directive named "foo" on the merged field. How you decide which one to use is up to your code.NOTE: A future version of the interface will try to add access to the inherited directives from parent fields and fragments. This proved to be a non-trivial problem and hence we decide to give access to immediate field directives and provide this holder interface, so we can add the other directives in the future
- See Also:
MergedField
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.List<QueryAppliedDirective>
getImmediateAppliedDirective(java.lang.String directiveName)
This will return a list of the named applied directives that are immediately on this merged field.java.util.Map<Field,java.util.List<QueryAppliedDirective>>
getImmediateAppliedDirectivesByField()
This will return a map of theField
s inside aMergedField
and the immediate applied directives that are on each specific fieldjava.util.Map<java.lang.String,java.util.List<QueryAppliedDirective>>
getImmediateAppliedDirectivesByName()
This will return a map of the applied directives that are immediately on a merged fieldjava.util.List<GraphQLDirective>
getImmediateDirective(java.lang.String directiveName)
Deprecated.- use theQueryAppliedDirective
methods insteadjava.util.Map<Field,java.util.List<GraphQLDirective>>
getImmediateDirectivesByField()
Deprecated.- use theQueryAppliedDirective
methods insteadjava.util.Map<java.lang.String,java.util.List<GraphQLDirective>>
getImmediateDirectivesByName()
Deprecated.- use theQueryAppliedDirective
methods instead
-
-
-
Method Detail
-
getImmediateAppliedDirectivesByName
java.util.Map<java.lang.String,java.util.List<QueryAppliedDirective>> getImmediateAppliedDirectivesByName()
This will return a map of the applied directives that are immediately on a merged field- Returns:
- a map of all the applied directives immediately on this merged field
-
getImmediateAppliedDirective
java.util.List<QueryAppliedDirective> getImmediateAppliedDirective(java.lang.String directiveName)
This will return a list of the named applied directives that are immediately on this merged field. Read above for why this is a list of applied directives and not just one- Parameters:
directiveName
- the named directive- Returns:
- a list of the named applied directives that are immediately on this merged field
-
getImmediateDirectivesByName
@Deprecated java.util.Map<java.lang.String,java.util.List<GraphQLDirective>> getImmediateDirectivesByName()
Deprecated.- use theQueryAppliedDirective
methods insteadThis will return a map of the directives that are immediately on a merged field- Returns:
- a map of all the directives immediately on this merged field
-
getImmediateAppliedDirectivesByField
java.util.Map<Field,java.util.List<QueryAppliedDirective>> getImmediateAppliedDirectivesByField()
This will return a map of theField
s inside aMergedField
and the immediate applied directives that are on each specific field- Returns:
- a map of all directives on each field inside this
-
getImmediateDirective
@Deprecated java.util.List<GraphQLDirective> getImmediateDirective(java.lang.String directiveName)
Deprecated.- use theQueryAppliedDirective
methods insteadThis will return a list of the named directives that are immediately on this merged field. Read above for why this is a list of directives and not just one- Parameters:
directiveName
- the named directive- Returns:
- a list of the named directives that are immediately on this merged field
-
getImmediateDirectivesByField
@Deprecated java.util.Map<Field,java.util.List<GraphQLDirective>> getImmediateDirectivesByField()
Deprecated.- use theQueryAppliedDirective
methods insteadThis will return a map of theField
s inside aMergedField
and the immediate directives that are on each specific field- Returns:
- a map of all directives on each field inside this
-
-