Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defaultValue is pasted as toString() into the schema #148

Open
NikkyAI opened this issue Jun 6, 2021 · 1 comment
Open

defaultValue is pasted as toString() into the schema #148

NikkyAI opened this issue Jun 6, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@NikkyAI
Copy link

NikkyAI commented Jun 6, 2021

i configured a qury like so

type<FindAddonsConfig>() {
    description = "wrapper object for passing configurations to findAddons"
}
query("findAddons") {
    resolver { config: FindAddonsConfig ->
        ....
		listOf<String>()
    }.withArgs {
        arg<FindAddonsConfig> {
            name ="config"
            defaultValue = FindAddonsConfig()
        }
    }
}

this broke graphql clients and inspection
running the inspection query manually reveals

 "defaultValue": "FindAddonsConfig(gameIdList=null, categoryList=null, gameVersionList=null, idList=null, nameList=null, slugList=null, sectionList=null, statusList=null)"

in the response

my expectation was that this would be json encoded
is there a different (typesafe) overload for this i overlooked ?

i am using 0.17.7

@NikkyAI NikkyAI changed the title defaultValue is pasted verbatim into the schema defaultValue is pasted as toString() into the schema Jun 6, 2021
@jeggy jeggy added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jun 6, 2021
@jeggy
Copy link
Member

jeggy commented Jun 10, 2021

Hi @NikkyAI. By following the §4.5.4, it states that it may return a string value. So I'm interested in which client you are using as it should be valid response?

But as it does say "may", I will keep this issue open, so we can change the response to a "stringified json object" instead of just using .toString().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants