'GraphQL query in GraphiQL yields error "Variable \"$id\" of required type \"ID!\" was not provided."

I am trying to call my graphql API in two different ways.

The first version works and yields the expected error message:

enter image description here

The second version doesn't work. I expected the same or a similar output as for the first version:

enter image description here

Why?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source