Package graphql.annotations.connection
Annotation Type GraphQLConnection
-
@Target({FIELD,METHOD,TYPE}) @Retention(RUNTIME) public @interface GraphQLConnectionSpecifies that the annotated field or method (given it is also annotated withGraphQLField) is a collection that will be adhering Relay Connection specification At the moment, the only allowed type for such field isList<?>
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanasyncBy default, the paginated data is fetched synchronously.java.lang.Class<? extends ConnectionFetcher>connectionFetcherBy default, a paginated data connection is specified.java.lang.Class<? extends graphql.relay.Relay>connectionTypeBy default, the relay connection that the container has is used.java.lang.StringnameBy default, wrapped type's name is used for naming TypeConnection, but can be overridden using this propertyjava.lang.Class<? extends ConnectionValidator>validatorBy default, the the validator validates a paginated data connection.
-
-
-
Element Detail
-
connectionFetcher
java.lang.Class<? extends ConnectionFetcher> connectionFetcher
By default, a paginated data connection is specified. this property allows for more efficient fetching procedures (limiting database queries, etc.) NOTE: if you override this, you should also override the validator field, and specify your own connection validator- Returns:
- a connection class
- Default:
- graphql.annotations.connection.PaginatedDataConnectionFetcher.class
-
-
-
validator
java.lang.Class<? extends ConnectionValidator> validator
By default, the the validator validates a paginated data connection. Can be overridden (and should be) if you are using a custom connection- Returns:
- a connection validator
- Default:
- graphql.annotations.connection.PaginatedDataConnectionTypeValidator.class
-
-
-
connectionType
java.lang.Class<? extends graphql.relay.Relay> connectionType
By default, the relay connection that the container has is used. If you want to change the way connection works (For example, you don't want edges and nodes), override theRelayclass and specify it.- Returns:
- a class that represents the connection type
- Default:
- graphql.annotations.connection.FakeRelay.class
-
-