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

Validate against using keys that haven't been declared #3227

Closed
wants to merge 8 commits into from

Conversation

JacksonKearl
Copy link

Closes #3202

return errors;
};

const selectionSetToString = (a: FieldNode[]): string =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use graphql.print() for this or is the outcome different from what I'm imagining?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gave weird formatting in my experience, also it doesn't operate that smoothly with the FieldNode array, and we don't have a SelectionSet to pass it, so idk. Left a comment.

Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after addressing nits, I'd like to let @jbaxleyiii give thumbs up on error message and code. We could potentially offer the user a list of valid keys in the error, but my hesitation is how to display them, especially considering 1 valid key vs n valid keys. I'm interested in a nice approach to this if possible, but don't have a suggestion.

@trevor-scheer
Copy link
Member

While this is a valid contribution, this PR has gone stale and was forgotten about (my fault). I recently added some key validations in #4498 which obsolete the need for this, so I'm closing it.

@trevor-scheer trevor-scheer deleted the key-not-declared-validation branch September 21, 2020 14:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Federation] @key agreement and usage clarification
3 participants