Skip to content

Commit 35dfc1b

Browse files
committed
Added annotation to simplify the use of "simpleConnection"
1 parent 23caeaf commit 35dfc1b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
* At the moment, the only allowed type for such field is <code>List&lt;?&gt;</code>
3131
*/
32-
@Target({ElementType.FIELD, ElementType.METHOD})
32+
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
3333
@Retention(RetentionPolicy.RUNTIME)
3434
public @interface GraphQLConnection {
3535
/**
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package graphql.annotations.connection.simple;
2+
3+
import graphql.annotations.connection.GraphQLConnection;
4+
5+
import java.lang.annotation.ElementType;
6+
import java.lang.annotation.Retention;
7+
import java.lang.annotation.RetentionPolicy;
8+
import java.lang.annotation.Target;
9+
10+
@Target({ElementType.FIELD, ElementType.METHOD})
11+
@Retention(RetentionPolicy.RUNTIME)
12+
@GraphQLConnection(connectionFetcher = SimplePaginatedDataConnectionFetcher.class, validator = SimplePaginatedDataConnectionTypeValidator.class, connectionType = SimpleRelay.class)
13+
public @interface SimpleGraphQLConnection {
14+
}

0 commit comments

Comments
 (0)