Neal Sanche
05/04/2021, 11:18 PMMartin Brehovsky
05/06/2021, 7:57 PMJilles van Gurp
05/07/2021, 8:00 AMMartin Brehovsky
05/17/2021, 11:51 AMNikky
05/18/2021, 7:40 AMRupesh
05/27/2021, 2:45 AMJoe
05/29/2021, 1:33 AMJilles van Gurp
06/07/2021, 10:27 AMcom.expediagroup.graphql.generator.exceptions.TypeNotSupportedException
during schema generation where apparently one of my functions returns Unit which is not allowed. The problem is it does not tell me where the error is. Is there a way to get more detailed errors? Once I know where the error is, I can fix it. It would be helpful to improve this as this seems to happen a lot to me. In this case, complete mystery where the error is.Martin Brehovsky
06/16/2021, 12:57 AMKotlinDataLoader
and my custom context derived from SpringGraphQLContext
. Is there any way to use the custom context from the dataloader itself?rocketraman
07/01/2021, 6:19 PMMartin Brehovsky
07/12/2021, 11:52 PMMiles Alden
07/14/2021, 12:29 AMinterface TourService {
@POST("/")
suspend fun toursQuery(
@Header("Authorization") auth: String,
@Header("Content-Type") content: String = "application/json",
@Body body: String): List<Tour>
}
object ApolloBuilder {
private const val BASE_URL = "<https://somewhere.com>"
private fun getApollo(): ApolloClient {
return ApolloClient.builder()
.serverUrl(BASE_URL)
.build()
}
}
I assumed that the @Header
annotation would magik things in 😄edwinRNDR
07/16/2021, 12:04 PMclass KtorGraphQLRequestParser(
private val mapper: ObjectMapper
) : GraphQLRequestParser<ApplicationRequest> {
@Suppress("BlockingMethodInNonBlockingContext")
override suspend fun parseRequest(request: ApplicationRequest): GraphQLServerRequest = try {
val rawRequest = request.call.receiveText()
val encoded = rawRequest.toByteArray(Charsets.ISO_8859_1)
val decoded = String(encoded, Charsets.UTF_8)
mapper.readValue(decoded, GraphQLServerRequest::class.java)
} catch (e: IOException) {
throw IOException("Unable to parse GraphQL payload.")
}
}
rocketraman
07/21/2021, 1:49 PMClosedRange<LocalDate>
. I have defined and registered a Coercing<ClosedRange<LocalDate>, String>
(and via debugger confirmed the coercer is being called at runtime), but I get a Jackson exception when parsing an Input:
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `kotlin.ranges.ClosedRange` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: my.MyInput["range"])
Any idea why that would be happening?Alex
07/26/2021, 8:12 PMschemaFileName
- added with 5.0.0-alpha.1
17 days ago ( https://github.com/ExpediaGroup/graphql-kotlin/commit/a6b957c999398c741cdfbc955fb86243ea211094 ) 🙌
The version 5.0.0-alpha.1
was not released due problems with maven central ( https://github.com/ExpediaGroup/graphql-kotlin/releases/tag/5.0.0-alpha.1 ) one should use the 5.0.0-alpha.2
- but last version of graphql gradle plugin I found is 5.0.0-alpha.0
=> https://search.maven.org/artifact/com.expediagroup/graphql-kotlin-gradle-plugin/5.0.0-alpha.0/jar
Was there a problem publishing the 5.0.0-alpha.2
and is there an alternative artifactory somewhere to test the 5.0.0-alpha.2
?Jilles van Gurp
07/28/2021, 7:35 AMTobias
08/10/2021, 8:08 AMTobias
08/11/2021, 5:58 AMerror: CommonErrorClass?
. It will be a bit hackish, but with some automatic schema validation it should work reliably. The problem is, I can figure out how to turn an Exception
into a custom specification?Tobias
08/13/2021, 9:38 AMTobias
08/23/2021, 6:03 PMgraphql-kotlin
together with a webserver called Armeria that has support for graphql-java (and an example for graphql-kotlin). The problem is that there is no way to get the RequestContext
in suspend functions, nor to use the Dispatchers provided by Armeria in an easy way. I've solved it by extending and overriding methods in FunctionDataFetcher
. It seems that runSuspendingFunction
has parameters for at least CoroutineContext
, so does that mean there are plans for greater configurability? E.g. by allowing the specification of a CoroutineContext
in the constructor of FunctionDataFetcher
or something similar?
I doubt the problem is unique to Armeria, since I can't figure out how to pass the context through to suspending methods without byte-code instrumenting graphql-kotlin runtime?edwinRNDR
09/06/2021, 7:00 PMDusan Hornik
09/26/2021, 8:52 AM@skip
and @include
and I am trying to implement @skipCache
query directive. The idea is that if request/client annotates field with @skipCache
the server will always recalculate the latest values (instead of using cached one).Julius Almeida
09/28/2021, 11:13 PM@AttributeOverrides(value = {
@AttributeOverride(name = "timestamp", column = @Column(name = "tstmp")),
@AttributeOverride(name = "id", column = @Column(name = "userid"))
})
I am getting
an annotation cannot be used as the annotations argument
Jilles van Gurp
10/01/2021, 8:45 AM@Component
class FormationGraphqlHooks : SchemaGeneratorHooks {
override fun willGenerateGraphQLType(type: KType): GraphQLType? {
return when (type.classifier as? KClass<*>) {
Long::class -> longScalar
Double::class -> doubleScalar
else -> null
}
}
}
private val longScalar = GraphQLScalarType.newScalar().name("Long")
.coercing(object : Coercing<Long,Any> {
override fun serialize(dataFetcherResult: Any): Any {
return dataFetcherResult
}
override fun parseValue(input: Any): Long {
return input as Long
}
override fun parseLiteral(input: Any): Long {
return input as Long
}
}).build()
private val doubleScalar = GraphQLScalarType.newScalar().name("Double")
.coercing(object : Coercing<Double,Any> {
override fun serialize(dataFetcherResult: Any): Any {
return dataFetcherResult
}
override fun parseValue(input: Any): Double {
return input as Double
}
override fun parseLiteral(input: Any): Double {
return input as Double
}
}).build()
Maria Sharkina
10/06/2021, 10:46 PMclass ConsumerMutation(
private val mutateDefaultConsumerAddressUseCase: MutateDefaultConsumerAddress
) : Mutation {
@GraphQLDescription("Updates default consumer address.")
fun setDefaultConsumerAddress(env: DataFetchingEnvironment, addressId: String): CompletableFuture<Consumer>
return mutateDefaultConsumerAddressUseCase.setDefaultConsumerAddress(env.getContext(), addressId).flatMap {
//want to reuse ConsumerDataLoader for result fetching
env.getValueFromMonoDataLoaderWithContext(ConsumerDataLoader::class, addressId).toMono()
}.toFuture()
}
}
Do you have any suggestions on how to use dataLoaders inside mutations or is it even a right pattern?Meg Cahill
10/08/2021, 4:22 PM`Variant 'apiElements' capability com.expediagroup:graphql-kotlin-ktor-client:5.0.0 declares an API of a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
xenomachina
10/13/2021, 5:46 PMHenrik Friedrichsen
10/18/2021, 7:29 AMGraphQLContext
changes in graphql-java
? Will graphql-kotlin
simply use graphql-java’s GraphQLContext
as passing custom object definitions seems to be deprecated?Martin Brehovsky
10/20/2021, 9:17 PM/graphql
endpoint and other schema would live on /other_graphql
endpoint. Is something like this possible? If yes, can you give me some pointers how to do this?Dusan Hornik
10/21/2021, 5:53 AMcom.expediagroup.graphql.exceptions.TypeNotSupportedException: Cannot convert T since it is not a valid GraphQL type or outside the supported packages
Code:
class MyQuery: Query {}
suspend fun students(pageNumber:Int): Page<Student> {
return getStudents(pageNumber)
}
}
data class Page<T>(val items: List<T>, pageNumber: Int)
data class Student(val name: String)
Is there a recommended way to design this?Dusan Hornik
10/21/2021, 5:53 AMcom.expediagroup.graphql.exceptions.TypeNotSupportedException: Cannot convert T since it is not a valid GraphQL type or outside the supported packages
Code:
class MyQuery: Query {}
suspend fun students(pageNumber:Int): Page<Student> {
return getStudents(pageNumber)
}
}
data class Page<T>(val items: List<T>, pageNumber: Int)
data class Student(val name: String)
Is there a recommended way to design this?Dariusz Kuc
10/21/2021, 9:55 PMPage
flavors (i.e. StudentPage
instead of generic Page<T>
)Dusan Hornik
10/22/2021, 12:17 AM