Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Variable defaults to null but has been omitted before #2890

@eliias

Description

@eliias

This commit has removed a condition that previously made the function return if a variable was optional and not set. From 2.5.0 on, every variable is set to null, if optional and not provided any value. I wonder if the new behaviour is intentional and just right or if this is a regression (could not find anything related in changelog).

Intended outcome:

variables: {}

Bildschirmfoto 2019-03-22 um 01 13 19

Actual outcome:

variables: {
  transform: null
}

Bildschirmfoto 2019-03-22 um 01 09 55

How to reproduce the issue:

Create a mutation with at least one optional variable. Call the mutation without a value for the optional variable.

Compared versions:

  • 2.4.1 (variable is not set)
  • 2.5.0, 2.5.1, 2.5.2 (all 2.5.x seems to have the regression)

The GraphQL query has an optional variable transform.

mutation saveX ($transform: Transform) {
  myX(transform: $transform) {
    …
  }
}

Version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions