sangria.execution.SimpleAstBasedExtensionMiddleware.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sangria-core_2.13 Show documentation
Show all versions of sangria-core_2.13 Show documentation
Scala GraphQL implementation
The newest version!
package sangria.execution
import sangria.ast
class SimpleAstBasedExtensionMiddleware[Ctx](
extensionFn: MiddlewareQueryContext[Ctx, _, _] => ast.Value)
extends Middleware[Ctx]
with MiddlewareExtension[Ctx] {
override type QueryVal = Unit
override def beforeQuery(context: MiddlewareQueryContext[Ctx, _, _]) = ()
override def afterQuery(queryVal: QueryVal, context: MiddlewareQueryContext[Ctx, _, _]) = ()
def afterQueryExtensions(queryVal: QueryVal, context: MiddlewareQueryContext[Ctx, _, _]) = {
import sangria.marshalling.queryAst._
Vector(Extension(extensionFn(context)))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy