Work item is refetched with `id=null` when Task modal is closed

Summary

When closing an open task modal on the issue page, the workItem GraphQL query is fired with id variable equal to null. This results in the error (not visible to the user because the modal is already closed.

Steps to reproduce

  1. Open an issue page
  2. Create a few tasks
  3. Open the task by clicking task link
  4. Open developer console on Network tab
  5. Close the modal

You should see a query workItem that results in an error.

Example Project

This bug reproduces on GitLab.com

What is the current bug behavior?

There is a query sent with the wrong parameter

What is the expected correct behavior?

There should be no query sent

Possible fixes

Refactor queryVariables prop and fix skip checks on queries.