manlan
08/25/2020, 5:23 PMherder
08/27/2020, 5:55 AMGraphQLContext
to be able to customize a callout to an external service, but I can't find how to get hold of the actual query body from the request? Is there a way to get hold of the raw query when creating my context?Saharath Kleips
08/27/2020, 5:51 PMDataFetchingEnvironment.selectionSet.definitions
object which seems to be what I want (or at least partially), but it doesn’t appear to contain fields requested from fragments.Lenny
08/28/2020, 12:56 AMHector Gonzalez
09/15/2020, 7:30 PMtim
09/16/2020, 1:08 PMRobert
09/22/2020, 4:39 PMDusan Hornik
09/23/2020, 1:09 PMDas135
09/30/2020, 9:57 AMmutation {
deleteObj1(where){
affectedRows
}
deleteObj2(where){
affectedRows
}
deleteObj3(where){
affectedRows
}
deleteObj4(where){
affectedRows
}
}
If order of executed functions will change, there can be thrown foreign key constraint condition -> I need to execute mutations like DELETE CASCADE...Lenny
10/15/2020, 6:21 PMhuehnerlady
10/16/2020, 1:31 PMDusan Hornik
10/19/2020, 10:42 AMhuehnerlady
10/20/2020, 2:11 PMDas135
10/21/2020, 7:43 AMdata class First(
val id: Long,
val name: String
) {
fun second(env: DataFetchingEnvironment): Second {
//query second class
}
}
fun First.another(env: DataFetchingEnvironment): Another {
// I need this function to be seen in graphql schema and resolver
}
Nikky
11/03/2020, 11:02 PMMartin Brehovsky
11/03/2020, 11:36 PMdata
section in the response, only errors
. Is it possible to get a response which would give me values for fetcher who did not fail and errors for the fetchers which fail? Something like this:
{
"data": {
"item": {
"foo": "foo"
},
}
"errors": [
{
"message": "Exception while fetching data (error) : I wonder what happends",
"locations": [
{
"line": 5,
"column": 3
}
],
"path": [
"bar"
],
"extensions": {}
}
]
}
Martin Brehovsky
11/03/2020, 11:44 PMhuehnerlady
11/09/2020, 12:35 PMMartin Brehovsky
11/11/2020, 12:55 AMMartin Brehovsky
11/14/2020, 2:37 AMDavid Glasser
11/18/2020, 7:37 PMMartin Brehovsky
12/01/2020, 3:10 AMabstract class Page<T:Any> {
@GraphQLIgnore
abstract fetchItems() ...
// these will be exposed in the schema
fun itemsCount(): Int
fun hasNextPage(): Boolean
fun pageItems: List<T>
}
class PageOfStrings: Page<String> {
override fetchItems() ...
}
class PageOfInts Page<Int> {
override fetchItems() ...
}
The resulting schema would have two types:
type PageOfStrings {
itemsCount: Int!
hasNextPage: Boolean!
pageItems: [String]!
}
type PageOfInts {
itemsCount: Int!
hasNextPage: Boolean!
pageItems: [Int]!
}
Is something like this doable?pcarrier
12/01/2020, 5:11 AM@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
sealed class Command {
@JsonTypeName("ResetCursorPosition")
data class ResetCursorPosition(
val dataSource: String, val position: Instant
) : Command()
}
which causes a failure in assertTypeUniqueness
; might I be missing some semi-obvious gotchas with the current implementation? Is it worth trying to minimize to a reproduction case? Otherwise the DX has been great so far.Anders Kirkeby
12/02/2020, 2:02 PMdata class TestClass(
val content: Set<String>
)
to remedy this, I’ve added a Hook with the following SchemaGeneratorHooks#willGenerateGrpahQLType method:
@ExperimentalStdlibApi
override fun willGenerateGraphQLType(type: KType): GraphQLType? = when {
type.isSubtypeOf(typeOf<Set<*>?>()) -> {
type.arguments.first().type?.let { kType ->
val typeRef = (kType.classifier as KClass<*>)
GraphQLList.list(GraphQLTypeReference.typeRef(typeRef.simpleName))
}
}
else -> null
}
this works when creating a query that returns TestClass or List<TestClass>. However, when creating a Query that returns a Set<TestClass> it fails as the TestClass reference has not yet been created. From what I could gather, this method should just create the reference to TestClass::class.simpleName
and the generator should generate the class in “due-time” which should lead to Set<TestClass> resolving as a GQLList<TestClass> in the playground, or am I missing something?Mattlangsenkamp
12/12/2020, 7:05 AMChris Wicks
12/15/2020, 4:17 PMNikky
01/12/2021, 1:53 PM{
"error": "Could not connect to websocket endpoint <ws://localhost:8080/subscriptions>. Please check if the endpoint url is correct."
}
not sure if this is a issue in plaground or in the library however
and seems like the GraphQLContextFactory
does not kick in for subscriptions
so we cannot figure out how to get access to Header Authorization
for subscriptions currentlyherder
01/12/2021, 3:39 PMFederatedTypeResolver
in a Boot applications, but how ever I do it I can't get it to kick in. I wonder if I'm misunderstanding somehing - I have a simple schema like this
@KeyDirective(FieldSet("id"))
data class MySubThing(val id: Int?, val extraThing: String)
data class MyThing(@ExtendsDirective val id: String, val subThings: List<MySubThing>) {
}
, and register this resolver class as a bean:
class MySubThingResolver: FederatedTypeResolver<MySubThing> {
override suspend fun resolve(
environment: DataFetchingEnvironment,
representations: List<Map<String, Any>>
): List<MySubThing?> {
return representations.stream().map {
MySubThing(it["id"]?.toString()?.toInt(), "WOOOP")
}.collect(Collectors.toList())
}
But I can't get the resolver to be called however I try. What is the recommended way of registering resolvers for a schema in a Boot app?
(I have set the graphql.federation.enabled
to true
)Jilles van Gurp
01/14/2021, 7:05 PMCaused by: com.expediagroup.graphql.exceptions.CouldNotCastGraphQLSchemaElement: Could not cast GraphQLSchemaElement GraphQLInterfaceType{name='GeoJsonGeometry', description='null', fieldDefinitionsByName=[type], typeResolver=null} to class graphql.schema.GraphQLInputType
This is the sealed class
sealed class GeoJsonGeometry(val type: GeometryType) {
class Point(type: GeometryType = GeometryType.Point): GeoJsonGeometry(type)
class Polygon(type: GeometryType = GeometryType.Polygon): GeoJsonGeometry(type)
}
Simply adding a val geometry: GeoJsonGeometry?=null
to our input date class breaks it, removing that fixes it.Joe
01/15/2021, 9:15 PMJoe
01/15/2021, 9:15 PMDariusz Kuc
01/15/2021, 9:39 PMShane Myrick
01/15/2021, 9:50 PM/graphql
over WS instead of standard http you can create your own graphql-kotlin-*-server
implementation