Quoting for "post default" values of string fields

#1

For a string field declaration in a type, is it mandatory (or advised) to double-wrap in single + double quotes the post-default value?

For example:
userPrefix: string post default '"test.user."'
vs
userPrefix: string post default 'test.user.'

0 Likes

#2

The value is an expression (as a string). So if you don’t put quotes inside, it will assume it is a field reference. So in your above example:

‘“test.user.”’ would be the string “test.user.”

and the

‘test.user.’ would be illegal since it would look for a field but it ends in ‘.’

0 Likes