@GraphQLField
which takes a sealed trait as a Parameter. Now I want to create an InputObject which has every implementation of the sealed trait as a property and then create an alias which fails if not exactly one property is Some
hey guys, need your advice:
switched sangria to 2.1.0
PR looks like this
"org.sangria-graphql" %% "sangria" % "1.4.2" => "2.1.0",
"org.sangria-graphql" %% "sangria-relay" % "1.4.2" => "2.1.0",
"org.sangria-graphql" %% "sangria-circe" % "1.2.1" => "1.3.1",
"org.sangria-graphql" %% "sangria-slowlog" % "0.1.8" => "2.0.1",
nothing else was changed.
And faced a memory leak 6 hours after the update (maybe related to traffic).
Maybe someone also faced mem leak at sangria 2.10 ?
Hi, I have a question about deferred resolution. Is there a way to run multiple deferred resolutions one by one? What I want to achieve in resolver function is:
for {
idsA <- deferredFetchA
idsB <- deferredFetchB
selectedItems <- do sth with idsA and idsB
} yield anotherDeferredFetch(selectedItems)
I was trying to play with DeferredValue(...)
but with no success
Deferred
.DeferredResolver
, you have access to all your accumulated Deferred
instances. Based on this input, you can choose how to resolve them. And this can be one by one if you want to.
Fetcher
, you might be interested in this change that allows setting the max concurrency: https://github.com/sangria-graphql/sangria/pull/454/filesCurrently getting an error when returning a large page of results Fetcher has not resolved non-optional ID ‘<SOME_ID>’
I’ve looked at the ids thrown by the error and found the objects/entities they refer to (it’s a nested object inside the object being queried) and they exist
I can do a more narrow query that filters for that specific object and get page with 1 result.
It so far only seems to blow up when I have to many.
Perhaps this is an issue with a the Future for the Field
being queried is resolving before the defered resolver finishes?
sangria.execution.deferred.AbsentDeferredValueError
implicit def validatedType[A](
implicit lookup: GraphQLOutputTypeLookup[A]
): GraphQLOutputTypeLookup[Validated[A]] =
new GraphQLOutputTypeLookup[Validated[A]] {
def graphqlType: OutputType[Validated[A]] =
ObjectType(
s"Validated${lookup.graphqlType.namedType.name}",
fields[Ctx, Validated[A]](
Field("value", lookup.graphqlType, resolve = _.value.value),
Field(
"fatal",
ListType(FatalType),
resolve = _.value.status.fatal
),
Field(
"warning",
ListType(WarningType),
resolve = _.value.status.warning
)
)
)
}
Validated[String]
and Validated[Option[String]]
. If only one or the other is present, it works as expected ( in elm I get a Maybe String
in the generated graphql object). But if both are present, only one is generated. So in my case, only a ValidatedString
type exists, and its not a Maybe String
in elm land.
Validated
looks like this: case class Validated[A](value: A, status: Status) {
def map[B](f: A => B): Validated[B] =
copy(value = f(value))
}
s"Validated${lookup.graphqlType.namedType.name}",
lookup.graphqlType.namedType
reaches into option to get the wrapped type