Skip to content

Remove string literal default value from non-string types in generated types #883

@jiholee17

Description

@jiholee17

Some non-string GraphQL types are serialized as a string, making it possible to define default values for input fields in a schema like this:

input MyInput {
    uri: Uri = "https://someurl.com"
}

Currently, the generated Java code from this type (using a type mapping from "Uri" : "java.net.URI") has:

public class MyInput {
    private URI uri = "https://someurl.com";
    ...

which does not compile.

Instead, we can remove the string literal default value from the generated type because the default is set by DGS at runtime, producing the following generated type:

public class MyInput {
    private URI uri;
    ...

Metadata

Metadata

Assignees

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