Skip to content

Support for default schema values #53

Open
@smyrick

Description

@smyrick

The GraphQL spec allows for arguments to have default values:

Kotlin allows specifying default values:

This information is not available on reflection though due to the way Kotlin compiles to the JVM:

We could solve this issue by adding a new annotation @GraphQLDefaultValue. This would require developers to duplicate some information but I think it would be worth it until we have a better way of extracting the info

fun getWidget(id: Int, @GraphQLDefaultValue(WidgetType.UNICORN) type: WidgetType = WidgetType.UNICORN) {
    return database.getWidgetByIdAndType(id, type)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: generatorIssue affects the schema generator and federation codetype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions