-
Hello, I am kind of stuck with how one would go about de/serialization of The Quarkus JAX-RS Jackson example does not have Keyset Pagination and there is no JSON-B example. Would it possible for you to create these examples showcasing the recommended way of working with the library? Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, the serialization part was deliberately not handled out of the box because everyone probably has a different opinion about how this should be done. For GraphQL we use Java serialization with a serialization filter, so that only the basic types of the entity domain can be deserialized. You could use something similar. Also see https://github.com/Blazebit/blaze-persistence/blob/main/integration/graphql/src/main/java/com/blazebit/persistence/integration/graphql/GraphQLRelayPageInfo.java#L60 and https://github.com/Blazebit/blaze-persistence/blob/main/integration/graphql/src/main/java/com/blazebit/persistence/integration/graphql/GraphQLCursorObjectInputStream.java I honestly don't know how to best model this in Quarkus native though. Is serialization supported now in native images? You can alternatively serialize the keyset into JSON though and include the type in the payload, as you suggested, though you will probably need something similar to the deserialization filter and I am not sure all JSON libraries provide an easy way to do this. Also see: https://github.com/Blazebit/blaze-persistence/blob/main/integration/graphql/src/main/java/com/blazebit/persistence/integration/graphql/GraphQLEntityViewSupportFactory.java#L476 |
Beta Was this translation helpful? Give feedback.
Hi,
the serialization part was deliberately not handled out of the box because everyone probably has a different opinion about how this should be done. For GraphQL we use Java serialization with a serialization filter, so that only the basic types of the entity domain can be deserialized. You could use something similar. Also see https://github.com/Blazebit/blaze-persistence/blob/main/integration/graphql/src/main/java/com/blazebit/persistence/integration/graphql/GraphQLRelayPageInfo.java#L60 and https://github.com/Blazebit/blaze-persistence/blob/main/integration/graphql/src/main/java/com/blazebit/persistence/integration/graphql/GraphQLCursorObjectInputStream.java
I honestly don't know how…