Package graphql.schema.visitor
Interface GraphQLSchemaVisitor
-
@PublicSpi public interface GraphQLSchemaVisitor
This visitor interface offers more "smarts" aboveGraphQLTypeVisitor
and aims to be easier to use with more type safe helpers.You would use it places that need a
GraphQLTypeVisitor
by doing `new GraphQLSchemaVisitor() { ...}.toTypeVisitor()`
-
-
Nested Class Summary
-
Method Summary
-
-
-
Method Detail
-
visitAppliedDirective
default GraphQLSchemaTraversalControl visitAppliedDirective(GraphQLAppliedDirective appliedDirective, GraphQLSchemaVisitor.AppliedDirectiveVisitorEnvironment environment)
Called when visiting a GraphQLAppliedDirective in the schema- Parameters:
appliedDirective
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitAppliedDirectiveArgument
default GraphQLSchemaTraversalControl visitAppliedDirectiveArgument(GraphQLAppliedDirectiveArgument appliedDirectiveArgument, GraphQLSchemaVisitor.AppliedDirectiveArgumentVisitorEnvironment environment)
Called when visiting aGraphQLAppliedDirectiveArgument
in the schema- Parameters:
appliedDirectiveArgument
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitArgument
default GraphQLSchemaTraversalControl visitArgument(GraphQLArgument argument, GraphQLSchemaVisitor.ArgumentVisitorEnvironment environment)
Called when visiting aGraphQLArgument
in the schema- Parameters:
argument
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitDirective
default GraphQLSchemaTraversalControl visitDirective(GraphQLDirective directive, GraphQLSchemaVisitor.DirectiveVisitorEnvironment environment)
Called when visiting aGraphQLArgument
in the schema- Parameters:
directive
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitEnumType
default GraphQLSchemaTraversalControl visitEnumType(GraphQLEnumType enumType, GraphQLSchemaVisitor.EnumTypeVisitorEnvironment environment)
Called when visiting aGraphQLEnumType
in the schema- Parameters:
enumType
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitEnumValueDefinition
default GraphQLSchemaTraversalControl visitEnumValueDefinition(GraphQLEnumValueDefinition enumValueDefinition, GraphQLSchemaVisitor.EnumValueDefinitionVisitorEnvironment environment)
Called when visiting aGraphQLEnumValueDefinition
in the schema- Parameters:
enumValueDefinition
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitFieldDefinition
default GraphQLSchemaTraversalControl visitFieldDefinition(GraphQLFieldDefinition fieldDefinition, GraphQLSchemaVisitor.FieldDefinitionVisitorEnvironment environment)
Called when visiting aGraphQLFieldDefinition
in the schema- Parameters:
fieldDefinition
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitInputObjectField
default GraphQLSchemaTraversalControl visitInputObjectField(GraphQLInputObjectField inputObjectField, GraphQLSchemaVisitor.InputObjectFieldVisitorEnvironment environment)
Called when visiting aGraphQLInputObjectField
in the schema- Parameters:
inputObjectField
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitInputObjectType
default GraphQLSchemaTraversalControl visitInputObjectType(GraphQLInputObjectType inputObjectType, GraphQLSchemaVisitor.InputObjectTypeVisitorEnvironment environment)
Called when visiting aGraphQLInputObjectType
in the schema- Parameters:
inputObjectType
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitInterfaceType
default GraphQLSchemaTraversalControl visitInterfaceType(GraphQLInterfaceType interfaceType, GraphQLSchemaVisitor.InterfaceTypeVisitorEnvironment environment)
Called when visiting aGraphQLInterfaceType
in the schema- Parameters:
interfaceType
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitObjectType
default GraphQLSchemaTraversalControl visitObjectType(GraphQLObjectType objectType, GraphQLSchemaVisitor.ObjectVisitorEnvironment environment)
Called when visiting aGraphQLObjectType
in the schema- Parameters:
objectType
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitScalarType
default GraphQLSchemaTraversalControl visitScalarType(GraphQLScalarType scalarType, GraphQLSchemaVisitor.ScalarTypeVisitorEnvironment environment)
Called when visiting aGraphQLScalarType
in the schema- Parameters:
scalarType
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitUnionType
default GraphQLSchemaTraversalControl visitUnionType(GraphQLUnionType unionType, GraphQLSchemaVisitor.UnionTypeVisitorEnvironment environment)
Called when visiting aGraphQLUnionType
in the schema- Parameters:
unionType
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
visitSchemaElement
default GraphQLSchemaTraversalControl visitSchemaElement(GraphQLSchemaElement schemaElement, GraphQLSchemaVisitor.SchemaElementVisitorEnvironment environment)
Called when visiting anyGraphQLSchemaElement
in the schema. Since every element in the schema is a schema element, this visitor method will be called back for every element in the schema- Parameters:
schemaElement
- the schema element being visitedenvironment
- the visiting environment- Returns:
- a control value which is typically
GraphQLSchemaVisitorEnvironment.ok()
}
-
toTypeVisitor
default GraphQLTypeVisitor toTypeVisitor()
This allows you to turn this smarter visitor into the baseGraphQLTypeVisitor
interface- Returns:
- a type visitor
-
-