Skip to content

Conversation

nightscape
Copy link

Ok, this is ugly as hell, but maybe a starting point for discussion.
I've changed the logic of HttpDirectiveProvider to return a RequestDescription <: Deferred[Json] and created a RequestResolver <: DeferredResolver[GatewayContext] which performs the actual logic.
In principle one could now go ahead and transform a Vector[RequestDescription] into batch requests, but there's too many things that feel just awfully wrong:

  1. RequestDescription needs to store the entire Context[GatewayContext, _] so that the RequestResolver can execute its logic. It would be much nicer if it would suffice to have a GatewayContext which would be the Ctx of RequestResolver anyway, but Context[GatewayContext, _] is needed for fillPlaceholders.
  2. I don't know if it's ok to just replace the schemaInfo.deferredResolver. It seems that it's an empty resolver by default.
  3. It would be much nicer to use the high-level Fetcher API. The point where I got stuck with this is that a Fetcher needs a HasId[Res, Id], so Id can't be something complicated like my RequestDescription. But if I make Id something simple like a Json object, I wouldn't know how to get all the other required things into the Fetcher.

If you have any ideas how to make this nicer I'd be very thankful 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant