Default argument values in type definitions and in Go templates

Hey! I’ve been recently looking into a UDG feature and I wonder if there is any possibility to configure default values for GraphQL query arguments?

type Query {
getSomethingWithPaging(id: ID!, pageNum: Int = 1, pageSize: Int = 10)

I think this feature is supported by GraphQL.js for example.

As an alternative, I tried to set default values using Go templates like so {{ or .arguments.pageNum 1 }}.
Didn’t work for me either.

Am I doing something wrong?

Hi @vskolo, I’m from the UDG team.
We’ll look into this and see if default values are already supported by our GraphQL engine.
I’ll get back to you once I know more.

The workaround you proposed with the go templating syntax is not supported but it’s an interesting idea! Are you able to use UDG without default values in the meantime?

Hey @Jens_Neuse. Sorry that I’m a bit late with an answer, but yea, I found a way to use UDG without default values by always supplying the default values with a query on a client side. Thanks for your attention to my question.