Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip visiting directive arguments when collecting usage #1224

Merged
merged 4 commits into from
Feb 10, 2023

Conversation

rperryng
Copy link
Contributor

@rperryng rperryng commented Feb 2, 2023

Background

fixes #1220

GraphQL visitor typeInfo.getFieldDef() yields undefined when visiting arguments of a directive applied to a fragment spread within a fragment.

Description

When visiting a GraphQL operation, skip visiting the arguments of a directive - there is no value in visiting directive arguments (or even directives in general) in the context of determining field usage

Client side GraphQL directives on query documents don't affect the actual field usage of a schema. i.e. it wouldn't matter if @skip or @include exclude a field for a particular operation - the execution of a query would fail if the schema didn't have the fields in the first place.

Checklist

@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2023

🦋 Changeset detected

Latest commit: 42b662b

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 Minor

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 kamilkisiela force-pushed the argument-directive-bug branch from 93437e9 to 42b662b Compare February 10, 2023 11:43
@kamilkisiela kamilkisiela merged commit cf14c18 into graphql-hive:main Feb 10, 2023
@rperryng rperryng deleted the argument-directive-bug branch February 10, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

client fails to collect operation with @include directive on fragment spread
2 participants