I am trying to integrate Sangria middleware to log slow GraphQL queries in my application but getting the following compilation
Error:
type mismatch;
found : sangria.schema.Schema[models.UserRepo,Unit]
required: sangria.schema.Schema[Any,Unit]
Note:models.UserRepo <:Any,but class Schema is invariant in type
Ctx.
You may wish to define Ctx as +Ctx instead. (SLS 4.5)
Error occurred in an application involving default arguments.
Code snippet:
val Query = ObjectType("Query", List[Field[UserRepo, Unit]]
(Field("store", StoreType, resolve = _ ⇒ ()) ))
val schema = Schema(Query, Some(MutationType))
val logResult = Executor.execute(SchemaDefinition.schema,
query.asInstanceOf[Document], middleware = SlowLog(newlogger,
threshold = 10 seconds) :: Nil)
Here is the reference link: https://github.com/sangria-graphql/sangria-slowlog
Kindly help me to know what is a proper signature of Executor.execute(????)
Thanks!