Package io.smallrye.graphql.api
Annotation Type ToScalar
-
@Retention(RUNTIME) @Target({TYPE,FIELD,PARAMETER,METHOD}) @Documented @Experimental("Allow you to map to a certain scalar class. Not covered by the specification. Subject to change.") @Deprecated public @interface ToScalar
Deprecated.Use AdaptToScalarAllows users to map a certain field or class to a scalar type
This is an experimental feature that might move to the spec.
Example:public class Profile { // Map a Scalar to another existing Scalar @ToScalar(Scalar.Int.class) private Long id; // Map a POJO to another existing Scalar @ToScalar(Scalar.String.class) private IdNumber idNumber; // Map a List of POJOs to a list of existing Scalars @ToScalar(Scalar.String.class) private List<Website> bookmarks; // other getters/setters... }
- Author:
- Phillip Kruger ([email protected])
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
deserializeMethod
Deprecated.
-