Batching with GraphQL #39220
-
I am trying to implement batching with GraphQL. I currently have queries: How do I set up batching? The current code I have is:
However, when calling the query:
I can't seem to get batching working, I'd expect an empty name value (given I'm using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 33 replies
-
/cc @jmartisk (graphql), @phillip-kruger (graphql) |
Beta Was this translation helpful? Give feedback.
-
You can change the see https://www.youtube.com/live/PHWOzzusfrY?feature=shared&t=2752 |
Beta Was this translation helpful? Give feedback.
OK. There is a few things going on here.
The original error you are getting is due to Lombok's equals and hashcode. I removed the
@EqualsAndHashCode(callSuper = false)
and@Data
on bothComponent
andComponentType
and added@Getter @Setter
The parameter passes into the GraphQL
@Source
method needs to match the response type of the@Query
. So I changedpublic Uni<List<ComponentType>> batchedType(@Source List<Component> components)
to
public Uni<List<ComponentType>> batchedType(@Source Uni<List<Component>> components)
in
ComponentResource
So you have:
on
Component
So in Gr…