Skip to content

Default values not working for @GraphQLArgument in 0.9.8 #163

@szantogab

Description

@szantogab

HI!

Great release for 0.9.8, it was long awaited :)

One issue I encountered with 0.9.8 is that @GraphQLArgument seems to ignore defaultValue.

I have the following code:

    @GraphQLQuery(description = "Queries nearby ShoutOuts, that should be displayed on the map for the given user.")
    fun discoverShoutOuts(lat: Double, lng: Double, @GraphQLArgument(name = "radiusInMeters", defaultValue = "50000") radiusInMeters: Double): Collection<ShoutOut> = shoutOutService.discoverShoutOuts(lat, lng, radiusInMeters)

After upgrading to 0.9.8 the radiusInMeters argument is required and doesn't have a default value.

Is there anything to do with it to make it work?

I tried to debug it, and I see that in AnnotatedArgumentBuilder, the defaultValue() method correctly returns the value I specified, so the problem must be afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions