fix remote schema permissions with null default value

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6414
GitOrigin-RevId: 1b902b1ac7c541bdd79f933ef6fc008f875b517a
This commit is contained in:
Daniele Cammareri 2022-10-19 08:44:47 +02:00 committed by hasura-bot
parent 67087043c9
commit e91cba835b

View File

@ -512,6 +512,10 @@ const serialiseArgs = (args: ArgTreeType, argDef: GraphQLInputField) => {
let res = '{';
const { children } = getChildArguments(argDef);
if (args === null) {
return 'null';
}
Object.entries(args).forEach(([key, value]) => {
if (isEmpty(value) || isEmpty(children)) {
return;
@ -672,7 +676,7 @@ const getSDLField = (
valueStr = `${arg.name} : ${arg.type.inspect()}`;
// add default value after type definition if it exists
if (arg.defaultValue) {
if (arg.defaultValue !== undefined) {
const defaultValue = formatArg({
arg,
argName: arg.defaultValue,