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

add test for @key referencing list #2941

Closed
wants to merge 1 commit into from
Closed

Conversation

evans
Copy link
Contributor

@evans evans commented Jun 28, 2019

This PR demonstrates a lack of validation errors for array types in the @-key directive.

Expected: validations provide a warning when list types are referenced by a @-key directive.

https://github.com/apollographql/apollo-server/compare/evans/broken-requires-list?expand=1#diff-80ddba2f8f972a6873ae15bd107da23eR151 should have values inside of the array printed in the snapshot

TODO

  • fix arrays as keys, either explicitly banning them or supporting them as references

expect(errors).toHaveLength(0);

const warnings = validateKeyFieldsSelectInvalidType(schema);
expect(warnings).toMatchInlineSnapshot(`Array []`);
Copy link
Member

Choose a reason for hiding this comment

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

If this is supposed to be a warning, shouldn't the warning Array have something in it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! That's what this PR is supposed to highlight. I'll add some more to the description

@jbaxleyiii
Copy link
Contributor

@trevor-scheer iirc, didn't we talk about removing that limitation from the docs since both the planner and validator already support list types in keys?

@trevor-scheer
Copy link
Member

@trevor-scheer iirc, didn't we talk about removing that limitation from the docs since both the planner and validator already support list types in keys?

@jbaxleyiii looks like we can close this one out via #2841. I'll poke around the docs and look for any references to this.

@abernix abernix deleted the evans/broken-requires-list branch February 25, 2020 21:02
@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.

4 participants