-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding aspects and annotations #1128
Conversation
This is nice! |
a793fda
to
a3daad6
Compare
a3daad6
to
6a6d8d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor comments.
@@ -9,6 +9,7 @@ import caliban.wrappers.Wrapper.CombinedWrapper | |||
import caliban.{ CalibanError, GraphQLRequest, GraphQLResponse, ResponseValue } | |||
import zio.{ UIO, ZIO } | |||
import zio.query.ZQuery | |||
import caliban.{ GraphQL, GraphQLAspect } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: sort imports
* A symbolic alias for `withWrapper`. | ||
*/ | ||
final def @@[R2 <: R](wrapper: Wrapper[R2]): GraphQL[R2] = withWrapper(wrapper) | ||
final def @@[LowerR <: UpperR, UpperR <: R](aspect: GraphQLAspect[LowerR, UpperR]): GraphQL[UpperR] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some scaladoc here and in GraphQLAspect
?
36b408b
to
c350a4c
Compare
Unifies the
Wrapper
capabilities into a higher-level abstraction ofGraphQLAspect
the idea being that many of the existing specification capabilities require changes not just to the execution of the request but also to the underlying schema (adding directives, manipulating the underlying graphql).As a demonstration I refactored the
federate
function into a wrapper (though still kept the existing function for backward compatibility).