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

feat: provide validation rules via props #1716

Merged
merged 5 commits into from
Dec 1, 2020
Merged

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Nov 13, 2020

No description provided.

@acao
Copy link
Member

acao commented Nov 14, 2020

awesome start! now you’ll need to make sure that option is used here:

const rawResults = getDiagnostics(text, schema);

otherwise, i dont see where codemirror uses options.customValidationRules

@acao
Copy link
Member

acao commented Nov 14, 2020

you can also add this option to monaco graphql in this PR if you want, to be exhaustive.

i was going to add a similar feature to graphiql, codemirror-graphql and monaco now that autocomplete supports external fragment definitions

@acao
Copy link
Member

acao commented Nov 15, 2020

this is a very easy to add and powerful feature for [email protected], i really appreciate your help @n1ru4l !

Copy link
Member

@acao acao left a comment

Choose a reason for hiding this comment

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

last thing, just needs some basic tests, ideally for graphql-language-service-interface, codemirror-graphql and/or graphiql. i think the first two would be easiest. just pass a simple custom rule and confirm it is used, as an integration test

@acao
Copy link
Member

acao commented Nov 28, 2020

@n1ru4l do you want to update this PR to use the new table format for props?

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Nov 30, 2020

@acao Sorry for not responding, I will give this a try this evening :)

@codecov
Copy link

codecov bot commented Nov 30, 2020

Codecov Report

Merging #1716 (4b65601) into main (3cecc3d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1716      +/-   ##
==========================================
+ Coverage   67.06%   67.07%   +0.01%     
==========================================
  Files          87       87              
  Lines        4837     4839       +2     
  Branches     1329     1330       +1     
==========================================
+ Hits         3244     3246       +2     
  Misses       1359     1359              
  Partials      234      234              
Impacted Files Coverage Δ
packages/graphiql/src/components/GraphiQL.tsx 59.86% <ø> (ø)
packages/codemirror-graphql/src/lint.js 100.00% <100.00%> (ø)
packages/graphiql/src/components/QueryEditor.tsx 63.96% <100.00%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cecc3d...4b65601. Read the comment docs.

@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Nov 30, 2020

@acao I added a test for codemirror-graphql and graphql-language-service-interface!

@acao
Copy link
Member

acao commented Dec 1, 2020

fantastic, thank you! all is looking great for this iteration. merging this and I’ll cut a release by the weekend, if not sooner

@acao acao merged commit 0c5785c into graphql:main Dec 1, 2020
@n1ru4l n1ru4l deleted the validation-rules branch December 1, 2020 09:07
@acao
Copy link
Member

acao commented Dec 8, 2020

now available in [email protected]!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants