https://kotlinlang.org logo
Join SlackCommunities
Powered by
# kgraphql
  • n

    Nick

    08/17/2021, 9:06 AM
    Hey there! Does anyone have an example how I would use
    wrap
    ? I’m specifically trying to harness it for Authentication purposes but I can’t seem to figure it out.
    • 1
    • 1
  • t

    Tomas Kormanak

    03/18/2022, 3:51 PM
    Hi, I am using custom data class(Address) in mutation input an got this error:
    Copy code
    Introspection must provide output type for fields, but received: Address!.
    Used data classes:
    Copy code
    data class Address(
        val label: String? = null,
        val street: String? = null,
        val city: String? = null,
    )
    data class ChangeAddress(
        val userid:Id,
        val address: Address,
    )
    Mutation is defined like this:
    Copy code
    mutation("changeAddress") {
        resolver { input: ChangeAddress, context: Context ->
            // change the addresss.....            
        }
    }
    What could be the problem?
    • 1
    • 1
  • j

    jeggy

    05/31/2022, 7:38 PM
    After a long break. I'm back and I'm looking for more maintainers to help me maintain the project and grow the KGraphQL community. People are welcome to write to me privately here on slack and we can discuss more about becoming a maintainer. https://github.com/aPureBase/KGraphQL/discussions/187
    👍 1
    e
    d
    • 3
    • 3
  • i

    itzik kasovitch

    06/20/2022, 2:19 PM
    Hi, I am trying to figure out if the following case is supported by KGraphQL. I need to write an api where the input is something like the composite design patter.. For keeping the API general I want the input type to be the type of the base class. When I try to do it I get a
    Failed to coerce
    exception. So the input type would be:
    Copy code
    sealed class Base {
        data class Leaf(val prop: Int): Base()
        data class Composite(val prop: List<Base>): Base()
    }
    I tried different kind of kotlinx.serialization annotations to make it work but it seems like behind the scenes it failed since Jackson is used. Also when I try to use the base as an
    inputType
    I get an error that it doesn't have any fields. I also tried to use the derived classes as
    inputType
    . Without success. Last, in the examples I can only see something which returns a unionType (not something the accepts a unionType).
    j
    • 2
    • 2
  • i

    itzik kasovitch

    06/27/2022, 7:38 PM
    Hi, earlier today I found out that this bug causes characters in Japanese to be garbled in our application which uses KGraphQL. There is a workaround proposed on this thread. Would it make sense if I send a PR to apply the proposed workaround on this line for the benefit of other KGraphQL users?
    e
    j
    • 3
    • 5
  • i

    itzik kasovitch

    06/28/2022, 9:44 AM
    What do you propose to do if I need to support multiple graphql endpoints (public api and internal api for example). Looks like we can't call install twice. I also want a different schema per endpoint.
  • j

    jeggy

    06/28/2022, 9:45 AM
    have been thinking about that myself, not sure of which route to go. But am thinking about going with this solution: https://github.com/aPureBase/KGraphQL/issues/190
  • j

    jeggy

    06/28/2022, 9:46 AM
    then you could just call
    graphql
    multiple times, to create multiple graphql endpoints, or multiple for require authentication and not authentication
  • i

    itzik kasovitch

    06/28/2022, 9:48 AM
    Another option is to make it possible to configure multiple endpoints in the plugin
  • i

    itzik kasovitch

    06/28/2022, 9:49 AM
    And a separate schema for each
  • j

    jeggy

    06/28/2022, 9:50 AM
    could be, but the current design for the ktor plugin is a bit ugly when used with authentication
  • j

    jeggy

    06/28/2022, 9:50 AM
    https://kgraphql.io/Plugins/ktor/#context
  • j

    jeggy

    06/28/2022, 9:55 AM
    but for now, if you just create a PR for solving the issue, it will be included in the next release 🙂 But some bigger change is coming when upgrading to ktor 2.0 or moving to a route extension structure. And when moving to ktor, I will make sure that we will still have 1.x support also, probably in two different packages.
    👍 1
  • i

    itzik kasovitch

    06/28/2022, 9:56 AM
    You mean if I will solve it on top of my proposal?
  • j

    jeggy

    06/28/2022, 10:07 AM
    no, I mean I will just take your solution to that encoding issue, along with whatever solution we will move into in the future
    👍 1
  • m

    maaxgr

    07/17/2022, 1:43 PM
    @itzik kasovitch With some small tweaks you could install the plugin twice. I have that approach in production and it works: https://github.com/aPureBase/KGraphQL/pull/193 Don't know if this is something that could come to aPureBase-Upstream until the Design of #190 is implemented @jeggy.
    🙏 1
    👍 3
    j
    • 2
    • 2
  • w

    Wyatt Kennedy

    08/19/2022, 11:30 PM
    Hey I see that there is an introspection schema here and specified through the code. Is there a way to generate the json from this for use in other tools and clients?
    j
    • 2
    • 2
  • r

    Richard Prince

    11/22/2022, 9:41 AM
    Hey, is there an estimate on when KGraphQL 0.18.1 will be released?
    j
    e
    • 3
    • 4
  • n

    Nahuel Ourthe

    12/01/2022, 11:40 PM
    Hi people, I'm new in KGraphQL and I have the same problem that Tomas Kormanak solved... My problem is that I can't understand how he solved it.
    • 1
    • 2
  • l

    Lukáš Kúšik

    12/31/2022, 10:16 AM
    Is it possible to wrap errors in 200 OK responses (
    wrapErrors
    in
    GraphQL.Configuration
    ) but also log them into the console at the same time (behaviour with
    wrapErrors
    set to false)?
    j
    • 2
    • 3
  • a

    Andres

    01/13/2023, 2:00 PM
    👋 I am wondering how to get a request header in my resolver. I am assuming there is a way to grab it with the Context. However I can't seem to find an example and have been unable to figure it out on my end.
    n
    • 2
    • 3
  • n

    Nahuel Ourthe

    01/17/2023, 12:01 AM
    Hi people, I'm having a problem that I don't know if it is about kgraphql, but I don't know where to start. I can't use version
    0.18.1
    of kgraphql, I have to downgrade to
    0.18.0
    to use it.
    • 1
    • 2
  • t

    Tiago Nunes

    02/06/2023, 6:11 PM
    Hey guys, I created a thread sharing my notes while studying the internals of the library, in case it helps anyone else looking to contribute https://github.com/aPureBase/KGraphQL/discussions/213 Feedback is appreciated 🙂 and many thanks for this awesome project K
    💪 3
    🙌 1
    e
    • 2
    • 1
  • t

    Tiago Nunes

    02/07/2023, 5:32 PM
    Hi @jeggy, I want to propose significant changes in the library that would make it possible to fully support generic types. I'm proposing we rely only on java.lang.reflect.Type for associating to TypeDefs, and for all of the compilation logic. Basically we replace all uses of *KClass<*>* and KType with java.lang.reflect.Type, to avoid kotlin reflection limitations (Top reflection-based serialization libraries also rely exclusively on java.lang.reflect.Type under the hood: Jackson, Gson, Moshi). I've created a POF branch and this comment to describe the proposal in detail. Please let me know if this kind of change is something you agree with, in order to support the use case.
    a
    • 2
    • 2
  • m

    Mazhar Ibna Zahur

    02/26/2023, 9:44 AM
    how can i add extensions in graphql response. my response is like this
    Copy code
    data class GraphQLResponse(
        val data: String? = null,
        val errors: List<Error>? = null,
        val extensions: Map<String, Any>? = null
    )
  • i

    Ilya Nothen

    02/26/2023, 11:47 AM
    Hello! Is graphql-multipart supported?
  • a

    Andres

    03/14/2023, 4:44 PM
    Potential silly question here.. Is there a way to determine what fields a user is requesting for their response? I am thinking I should be able to optimize some database queries if I know they only want specific fields in the response.
    j
    n
    • 3
    • 3
  • a

    Andres

    03/21/2023, 7:52 PM
    Has anyone looked into supporting form-data so that we could do file uploads? ex; https://stackoverflow.com/questions/61892306/is-there-any-way-to-upload-files-via-postman-into-a-graphql-api
    a
    f
    • 3
    • 2
  • a

    abu naser

    12/01/2024, 9:46 PM
    apurebase graphql Library is not working with ktor3 . also tried expediagroup graphql .
    • 1
    • 1
  • r

    Richard Prince

    03/26/2025, 3:42 PM
    @jeggy, is it possible to approve or release this PR upgrading to Kotlin 2.1? https://github.com/aPureBase/KGraphQL/pull/224