Skip to content

Commit af9b2fa

Browse files
authored
Add missing JavaDoc (#180)
resolves #58
1 parent 67b9019 commit af9b2fa

15 files changed

+76
-2
lines changed

core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import org.neo4j.graphql.handler.relation.CreateRelationHandler
1515
import org.neo4j.graphql.handler.relation.CreateRelationTypeHandler
1616
import org.neo4j.graphql.handler.relation.DeleteRelationHandler
1717

18+
/**
19+
* Contains factory methods to generate an augmented graphql schema
20+
*/
1821
object SchemaBuilder {
1922

2023
/**
@@ -31,6 +34,12 @@ object SchemaBuilder {
3134
return buildSchema(typeDefinitionRegistry, config, dataFetchingInterceptor)
3235
}
3336

37+
/**
38+
* @param typeDefinitionRegistry a registry containing all the types, that should be augmented
39+
* @param config defines how the schema should get augmented
40+
* @param dataFetchingInterceptor since this library registers dataFetcher for its augmented methods, these data
41+
* fetchers may be called by other resolver. This interceptor will let you convert a cypher query into real data.
42+
*/
3443
@JvmStatic
3544
@JvmOverloads
3645
fun buildSchema(typeDefinitionRegistry: TypeDefinitionRegistry, config: SchemaConfig = SchemaConfig(), dataFetchingInterceptor: DataFetchingInterceptor? = null): GraphQLSchema {

core/src/main/kotlin/org/neo4j/graphql/handler/BaseDataFetcher.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import org.neo4j.graphql.Cypher
1111
import org.neo4j.graphql.aliasOrName
1212
import org.neo4j.graphql.handler.projection.ProjectionBase
1313

14+
/**
15+
* The is a base class for the implementation of graphql data fetcher used in this project
16+
*/
1417
abstract class BaseDataFetcher(val fieldDefinition: GraphQLFieldDefinition) : ProjectionBase(), DataFetcher<Cypher> {
1518

1619
override fun get(env: DataFetchingEnvironment?): Cypher {

core/src/main/kotlin/org/neo4j/graphql/handler/BaseDataFetcherForContainer.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import org.neo4j.cypherdsl.core.*
99
import org.neo4j.cypherdsl.core.Cypher.*
1010
import org.neo4j.graphql.*
1111

12+
/**
13+
* This is a base class for all Node or Relation related data fetcher.
14+
*/
1215
abstract class BaseDataFetcherForContainer(
1316
val type: GraphQLFieldsContainer,
1417
fieldDefinition: GraphQLFieldDefinition

core/src/main/kotlin/org/neo4j/graphql/handler/CreateTypeHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import org.neo4j.cypherdsl.core.Statement
66
import org.neo4j.cypherdsl.core.StatementBuilder
77
import org.neo4j.graphql.*
88

9+
/**
10+
* This class handles all the logic related to the creation of nodes.
11+
* This includes the augmentation of the create&lt;Node&gt;-mutator and the related cypher generation
12+
*/
913
class CreateTypeHandler private constructor(
1014
type: GraphQLFieldsContainer,
1115
fieldDefinition: GraphQLFieldDefinition

core/src/main/kotlin/org/neo4j/graphql/handler/CypherDirectiveHandler.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import org.neo4j.cypherdsl.core.Functions
99
import org.neo4j.cypherdsl.core.Statement
1010
import org.neo4j.graphql.*
1111

12+
/**
13+
* This class handles all logic related to custom Cypher queries declared by fields with a @cypher directive
14+
*/
1215
class CypherDirectiveHandler(
1316
private val type: GraphQLFieldsContainer?,
1417
private val isQuery: Boolean,

core/src/main/kotlin/org/neo4j/graphql/handler/DeleteHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import org.neo4j.cypherdsl.core.Statement
88
import org.neo4j.cypherdsl.core.StatementBuilder.OngoingUpdate
99
import org.neo4j.graphql.*
1010

11+
/**
12+
* This class handles all the logic related to the deletion of nodes.
13+
* This includes the augmentation of the delete&lt;Node&gt;-mutator and the related cypher generation
14+
*/
1115
class DeleteHandler private constructor(
1216
type: GraphQLFieldsContainer,
1317
private val idField: GraphQLFieldDefinition,

core/src/main/kotlin/org/neo4j/graphql/handler/MergeOrUpdateHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import org.neo4j.cypherdsl.core.Statement
1111
import org.neo4j.cypherdsl.core.StatementBuilder.OngoingMatchAndUpdate
1212
import org.neo4j.graphql.*
1313

14+
/**
15+
* This class handles all the logic related to the updating of nodes.
16+
* This includes the augmentation of the update&lt;Node&gt; and merge&lt;Node&gt;-mutator and the related cypher generation
17+
*/
1418
class MergeOrUpdateHandler private constructor(
1519
type: GraphQLFieldsContainer,
1620
private val merge: Boolean,

core/src/main/kotlin/org/neo4j/graphql/handler/QueryHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import org.neo4j.cypherdsl.core.Statement
88
import org.neo4j.graphql.*
99
import org.neo4j.graphql.handler.filter.OptimizedFilterHandler
1010

11+
/**
12+
* This class handles all the logic related to the querying of nodes and relations.
13+
* This includes the augmentation of the query-fields and the related cypher generation
14+
*/
1115
class QueryHandler private constructor(
1216
type: GraphQLFieldsContainer,
1317
fieldDefinition: GraphQLFieldDefinition)

core/src/main/kotlin/org/neo4j/graphql/handler/filter/OptimizedFilterHandler.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ typealias WhereClauseFactory = (
2424

2525
typealias ConditionBuilder = (ExposesWith) -> OrderableOngoingReadingAndWithWithoutWhere
2626

27+
/**
28+
* This its a specialized handler that uses an alternative approach for filtering. By using multiple MATCH clauses,
29+
* this can facilitate the use of optimizations within the neo4j database, which can lead to significant performance
30+
* improvements for large data sets.
31+
*
32+
* If this handler cannot generate an optimization for the passed filter, an [OptimizedQueryException] will be
33+
* thrown, so the calling site can fall back to the non-optimized logic
34+
*/
2735
class OptimizedFilterHandler(val type: GraphQLFieldsContainer) : ProjectionBase() {
2836

2937
fun generateFilterQuery(variable: String, fieldDefinition: GraphQLFieldDefinition, field: Field, readingWithoutWhere: OngoingReadingWithoutWhere, rootNode: PropertyContainer): OngoingReading {

core/src/main/kotlin/org/neo4j/graphql/handler/projection/ProjectionBase.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import org.neo4j.graphql.parser.ParsedQuery
1515
import org.neo4j.graphql.parser.QueryParser.parseArguments
1616
import org.neo4j.graphql.parser.QueryParser.parseFilter
1717

18-
18+
/**
19+
* This class contains the logic for projecting nodes and relations
20+
*/
1921
open class ProjectionBase {
2022
companion object {
2123
const val NATIVE_ID = "_id"

0 commit comments

Comments
 (0)