@removeNullVariables Directive
The @removeNullVariables
directive allows you to remove variables with null or empty object value from your GraphQL Query or Mutation Operations.
A potential use-case could be that you have a graphql upstream which is not accepting null values for variables. By enabling this directive all variables with null values will be removed from upstream query.
1
2
3
The directive @removeNullVariables
will transform variables json and remove top level null values.
1
So upstream will receive the following variables:
1
The same way empty objects could be removed:
1
So upstream will receive the following variables:
1