graphql-hive
graphql-hive copied to clipboard
(processVariables: true) do not collect input if variable is missing
Fix for the case when an optional variable is not provided
🦋 Changeset detected
Latest commit: abd836213d892332fde4f25bfe47f6d9d7e9f85a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Name | Type |
---|---|
@graphql-hive/client | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@kamilkisiela , I just pushed new changes. I didn't test anything yet, but it looks to me like it SHOULD be ok this way both from UI and GraphQL Inspector perspectives. Just want to hear your opinion before going forward.
@kamilkisiela I've tested it manually with a local instance of Hive and it looks good to me.
The test was done with the same schema as in usage-collector.spec.ts
.
The test scenario was the same as in (processVariables: true) should not collect input when corresponding variable is not provided
test case.
Please check attached screenshots. Here is a description of screenshots:
In the UI I can see that PaginationInput
was used 1 time while all fields were used zero times. This could be a little bit confusing, but this is what actually happened: fields weren't used but the input itself was used in the query definition.
hive schema:check
also works as expected: removing FilterInput.order
and ProjectOrderByInput
is considered a non-breaking change because they weren't used. Removing PaginationInput
and FilterInput.pagination
is considered a breaking change because they were used in the query.
What do you think? Can we merge this PR?


Thank you very very very much
I will deploy it to production tomorrow
woohoo, thank you @kamilkisiela !