Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reviewed By: kassens Differential Revision: D17815205 fbshipit-source-id: d9a1fc7d5ee25b73bf16674b2b26a8c47ea36b9c
- Loading branch information
1 parent
25c6769
commit 15e8d22
Showing
8 changed files
with
2 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
packages/relay-compiler/core/__tests__/RelayValidator-test.js
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
packages/relay-compiler/core/__tests__/__snapshots__/RelayValidator-test.js.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15e8d22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @alunyov! Is here some replacement for the removed
validationRules
? We are using it for some extra validation rules. Thanks for your answer.15e8d22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @mrtnzlml we've moved most of the GraphQL validation rules to RelayParser directly.
But some of them became a RelayTransforms - that doesn't change the IR, but validating the correctness of them.
For example (DisallowIdAsAlias): d55420b
The end-goal for us is to remove the dependency on the
graphql-js
schema implementation (which is used in GraphQL validations).So, if you have extra validation rules, you can make them Relay Transforms. And configure the compiler to use these transforms.
Just our of curiosity, are those extra validation rules you mentioned will apply to Relay in general?
15e8d22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation! :)
I don't think so. I am experimenting with it. We have basically two validators:
It looks like this:
Deprecated fields could be even Eslint rule but the idea was to show warnings first and after some time (specified in deprecation reason?) we could start throwing an error. It would be more difficult with Eslint. Moreover, we could even automatically transform the fields into the new version.
The second validation is implementation of this idea: http://blog.liu.se/olafhartig/2018/08/08/lightweight-summary-of-our-paper-semantics-and-complexity-of-graphql/ (we will move it to the server, but I need it to figure out what should be the threshold for real-world queries).
So probably not useful at all for Relay community.
15e8d22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you'll probably need to re-implement those as RelayTransform
For the second, I think, it's even better - because you can run it on already optimized (by compiler) queries, which will give you more accurate results.
15e8d22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, definitely! I was trying to figure out how to run it on the transformed queries. Thank you very much! :)