Annotation Type GraphQLConnection


  • @Target({FIELD,METHOD,TYPE})
    @Retention(RUNTIME)
    public @interface GraphQLConnection
    Specifies that the annotated field or method (given it is also annotated with GraphQLField) is a collection that will be adhering Relay Connection specification At the moment, the only allowed type for such field is List<?>
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean async
      By default, the paginated data is fetched synchronously.
      java.lang.Class<? extends ConnectionFetcher> connectionFetcher
      By default, a paginated data connection is specified.
      java.lang.Class<? extends graphql.relay.Relay> connectionType
      By default, the relay connection that the container has is used.
      java.lang.String name
      By default, wrapped type's name is used for naming TypeConnection, but can be overridden using this property
      java.lang.Class<? extends ConnectionValidator> validator
      By 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
      • name

        java.lang.String name
        By default, wrapped type's name is used for naming TypeConnection, but can be overridden using this property
        Returns:
        the wrapped type's name
        Default:
        ""
      • 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
      • async

        boolean async
        By default, the paginated data is fetched synchronously. If explicitly specified, asynchronous data fetching will be used.
        Returns:
        if async fetching to be used.
        Default:
        false
      • 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 the Relay class and specify it.
        Returns:
        a class that represents the connection type
        Default:
        graphql.annotations.connection.FakeRelay.class