question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for default schema values

See original GitHub issue

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)
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
smyrickcommented, Oct 17, 2019

@keerthi4308 Feel free to propose a solution or provide a PR! This is not being worked on by someone today so you can assign yourself if you would like.

As you can see from the previous discussion there is a bit of complexity on the best way to solve it

2reactions
Keerthi4308commented, Oct 17, 2019

I’m wondering if this issue is taken care by anyone? I would like to contribute to this repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default value | Opis JSON Schema
You can specify a default value for an item using the default keyword. When a data doesn't have a corresponding value, the value...
Read more >
How Does a Schema Support Default Fields or NULL Fields?
To enable the schema generated based on the JSON data sample supports the default value or null, select the Convert and Move and...
Read more >
Setting default values in data schema - MongoDB
Hello Enthusiast, I am implementing data schema. Here i have to mention default value to a field of document.
Read more >
Setting default values in the schema of a component in a Job
Note: At present, only tFileInputDelimited, tFileInputExcel, and tFixedFlowInput support default values in the schema. In the following example, the company ...
Read more >
Generic keywords — Understanding JSON Schema 2020-12 ...
The default keyword specifies a default value. This value is not used to fill in missing values during the validation process. Non-validation tools...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found