Package graphql.execution.directives
Class QueryDirectivesImpl
- java.lang.Object
-
- graphql.execution.directives.QueryDirectivesImpl
-
- All Implemented Interfaces:
QueryDirectives
public class QueryDirectivesImpl extends java.lang.Object implements QueryDirectives
These objects are ALWAYS in the context of a single MergedFieldAlso note we compute these values lazily
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface graphql.execution.directives.QueryDirectives
QueryDirectives.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private LockKit.ComputedOnce
computedOnce
private DirectivesResolver
directivesResolver
private com.google.common.collect.ImmutableMap<Field,java.util.List<QueryAppliedDirective>>
fieldAppliedDirectivesByField
private com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<QueryAppliedDirective>>
fieldAppliedDirectivesByName
private com.google.common.collect.ImmutableMap<Field,java.util.List<GraphQLDirective>>
fieldDirectivesByField
private com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<GraphQLDirective>>
fieldDirectivesByName
private GraphQLContext
graphQLContext
private java.util.Locale
locale
private MergedField
mergedField
private GraphQLSchema
schema
private java.util.Map<java.lang.String,java.lang.Object>
variables
-
Constructor Summary
Constructors Constructor Description QueryDirectivesImpl(MergedField mergedField, GraphQLSchema schema, java.util.Map<java.lang.String,java.lang.Object> variables, GraphQLContext graphQLContext, java.util.Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
computeValuesLazily()
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)
This will return a list of the named directives that are immediately on this merged field.java.util.Map<Field,java.util.List<GraphQLDirective>>
getImmediateDirectivesByField()
This will return a map of theField
s inside aMergedField
and the immediate directives that are on each specific fieldjava.util.Map<java.lang.String,java.util.List<GraphQLDirective>>
getImmediateDirectivesByName()
This will return a map of the directives that are immediately on a merged fieldprivate QueryAppliedDirectiveArgument
toAppliedArgument(GraphQLArgument argument)
private QueryAppliedDirective
toAppliedDirective(GraphQLDirective directive)
-
-
-
Field Detail
-
directivesResolver
private final DirectivesResolver directivesResolver
-
mergedField
private final MergedField mergedField
-
schema
private final GraphQLSchema schema
-
variables
private final java.util.Map<java.lang.String,java.lang.Object> variables
-
graphQLContext
private final GraphQLContext graphQLContext
-
locale
private final java.util.Locale locale
-
computedOnce
private final LockKit.ComputedOnce computedOnce
-
fieldDirectivesByField
private volatile com.google.common.collect.ImmutableMap<Field,java.util.List<GraphQLDirective>> fieldDirectivesByField
-
fieldDirectivesByName
private volatile com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<GraphQLDirective>> fieldDirectivesByName
-
fieldAppliedDirectivesByField
private volatile com.google.common.collect.ImmutableMap<Field,java.util.List<QueryAppliedDirective>> fieldAppliedDirectivesByField
-
fieldAppliedDirectivesByName
private volatile com.google.common.collect.ImmutableMap<java.lang.String,java.util.List<QueryAppliedDirective>> fieldAppliedDirectivesByName
-
-
Constructor Detail
-
QueryDirectivesImpl
public QueryDirectivesImpl(MergedField mergedField, GraphQLSchema schema, java.util.Map<java.lang.String,java.lang.Object> variables, GraphQLContext graphQLContext, java.util.Locale locale)
-
-
Method Detail
-
computeValuesLazily
private void computeValuesLazily()
-
toAppliedDirective
private QueryAppliedDirective toAppliedDirective(GraphQLDirective directive)
-
toAppliedArgument
private QueryAppliedDirectiveArgument toAppliedArgument(GraphQLArgument argument)
-
getImmediateDirectivesByField
public java.util.Map<Field,java.util.List<GraphQLDirective>> getImmediateDirectivesByField()
Description copied from interface:QueryDirectives
This will return a map of theField
s inside aMergedField
and the immediate directives that are on each specific field- Specified by:
getImmediateDirectivesByField
in interfaceQueryDirectives
- Returns:
- a map of all directives on each field inside this
-
getImmediateAppliedDirectivesByField
public java.util.Map<Field,java.util.List<QueryAppliedDirective>> getImmediateAppliedDirectivesByField()
Description copied from interface:QueryDirectives
This will return a map of theField
s inside aMergedField
and the immediate applied directives that are on each specific field- Specified by:
getImmediateAppliedDirectivesByField
in interfaceQueryDirectives
- Returns:
- a map of all directives on each field inside this
-
getImmediateDirectivesByName
public java.util.Map<java.lang.String,java.util.List<GraphQLDirective>> getImmediateDirectivesByName()
Description copied from interface:QueryDirectives
This will return a map of the directives that are immediately on a merged field- Specified by:
getImmediateDirectivesByName
in interfaceQueryDirectives
- Returns:
- a map of all the directives immediately on this merged field
-
getImmediateAppliedDirectivesByName
public java.util.Map<java.lang.String,java.util.List<QueryAppliedDirective>> getImmediateAppliedDirectivesByName()
Description copied from interface:QueryDirectives
This will return a map of the applied directives that are immediately on a merged field- Specified by:
getImmediateAppliedDirectivesByName
in interfaceQueryDirectives
- Returns:
- a map of all the applied directives immediately on this merged field
-
getImmediateDirective
public java.util.List<GraphQLDirective> getImmediateDirective(java.lang.String directiveName)
Description copied from interface:QueryDirectives
This 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- Specified by:
getImmediateDirective
in interfaceQueryDirectives
- Parameters:
directiveName
- the named directive- Returns:
- a list of the named directives that are immediately on this merged field
-
getImmediateAppliedDirective
public java.util.List<QueryAppliedDirective> getImmediateAppliedDirective(java.lang.String directiveName)
Description copied from interface:QueryDirectives
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- Specified by:
getImmediateAppliedDirective
in interfaceQueryDirectives
- Parameters:
directiveName
- the named directive- Returns:
- a list of the named applied directives that are immediately on this merged field
-
-