Closed KraftNSK closed 1 year ago
True && True
nonNull(GraphQLType)
accessible within the DSL when declaring a field's GraphQL type. This has to be added to documentation. Here an example taken from a test: GraphQLInputObjectType MailFilterType = DSL.input('MailFilter') {
field 'from', nonNull(GraphQLString)
field 'to', nonNull(GraphQLString)
}
Thanks for the feedback :+1:
I'm realizing graphql-java v14.0
doesn't support default values when using variable references. For example having a query definition like this one:
type Query {
hello(name: String = "amigo"): String
}
When you avoid passing the name argument, works as expected:
{
sayHello
}
It returns hello amigo
But if you use a variable reference structure:
query SayHello($name:String){
hello(name: $name)
}
it returns hello null
The problem is, that, in my experience the latter is the most common way of calling a GraphQL API from a frontend application.
I'm thinking of adding an issue to graphql-java
to change this behavior and use the default value also for variable references, but in the meantime adding the default value to the DSL and the current behavior is the best I can do.
Can you give me some feedback on this @KraftNSK ?
Fixed in graphql-java
Hi! The graphql supports the default values for the arguments, but this is not the case in this DSL (which sometimes is very distracting).
It is also unclear how to manage the mandatory parameters in dsl (analogue '!')
Thanks!