Skip to content

Commit 9aa489a

Browse files
committed
Added a validator field
1 parent 187d1b5 commit 9aa489a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/main/java/graphql/annotations/connection/GraphQLConnection.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,25 @@
3232
@Retention(RetentionPolicy.RUNTIME)
3333
public @interface GraphQLConnection {
3434
/**
35-
* By default, a simple List connection is specified, but can be overridden using
36-
* this property to allow for more efficient fetching procedures (limiting database queries, etc.)
35+
* By default, a paginated data connection is specified.
36+
* this property allows for more efficient fetching procedures (limiting database queries, etc.)
37+
* NOTE: if you override this, you should also override the validator field, and specify
38+
* your own connection validator
3739
* @return a connection class
3840
*/
39-
Class<? extends ConnectionFetcher> connection() default EnhancedConnectionFetcher.class;
41+
Class<? extends ConnectionFetcher> connection() default PaginatedDataConnectionFetcher.class;
4042

4143
/**
4244
* By default, wrapped type's name is used for naming TypeConnection, but can be overridden
4345
* using this property
4446
* @return the wrapped type's name
4547
*/
4648
String name() default "";
49+
50+
/**
51+
* By default, the the validator validates a paginated data connection.
52+
* Can be overridden (and should be) if you are using a custom connection
53+
* @return a connection validator
54+
*/
55+
Class <? extends ConnectionValidator> validator() default PaginatedDataConnectionTypeValidator.class;
4756
}

0 commit comments

Comments
 (0)