Summary
Example:
I have a type that has no required fields. There is a default argument for the only field
input MyType {
a: Float = 1.0
}
In my query, I provide a default argument
query myQuery($arg: MyType! = {})
When I run code gen, there are no errors from the script and I get the following output:
struct MyType {
public init(a: GraphQLNullable<Double>) {
...
}
}
class MyQuery {
public init(arg: MyType = MyType()) {...}
}
However, because the initializer for MyType does not include either a default argument of 1.0 or nil, the generated code fails to compile
MyQuery.graphql => Missing argument for parameter #1 in call
Version
1.5
Steps to reproduce the behavior
See the above code for an reproducible example
Logs
No response
Anything else?
No response
Summary
Example:
I have a type that has no required fields. There is a default argument for the only field
In my query, I provide a default argument
When I run code gen, there are no errors from the script and I get the following output:
However, because the initializer for
MyTypedoes not include either a default argument of1.0ornil, the generated code fails to compileMyQuery.graphql=>Missing argument for parameter #1 in callVersion
1.5
Steps to reproduce the behavior
See the above code for an reproducible example
Logs
No response
Anything else?
No response