Hi, 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(????) and to typecast query "(val query = "g.V().has('BaseModel','YearID','" + year + "').out('make').dedup()")" to document type.
How to fixed above type mismatch issues
Thanks!
val SchemaDefinition.schema : Schema[UserRepo, Unit]= Schema(Query, Some(MutationType))val query = "g.V().has('BaseVehicle','YearID','" + year + "').out('make').dedup()"
Executor.execute(SchemaDefinition.schema, query.asInstanceOf[Document], UserRepo.this, middleware = SlowLog(logger2, threshold = 10 seconds) :: Nil)
To view this discussion on the web visit https://groups.google.com/d/msgid/sangria-graphql/1b433442-87e9-4a8a-b19c-ddfe54e43d9e%40googlegroups.com.--
You received this message because you are subscribed to a topic in the Google Groups "sangria-graphql" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sangria-graphql/_ZUa8cBjQrU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sangria-graphql+unsubscribe@googlegroups.com.
To post to this group, send email to sangria-graphql@googlegroups.com.