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: implied or external fragments, for #612 #1750

Merged
merged 8 commits into from
Jan 7, 2021
Merged

Conversation

acao
Copy link
Member

@acao acao commented Jan 5, 2021

allows external, implied fragments in autocompletion, validation, and operation execution. resolves #612

  • adds this capability to monaco-graphql, codemirror-graphql, and graphiql
  • provide an array of fragment definitions or a string containing fragment definitions
  • only fragments you use are added in operation exec, thus in fetcher params as well
  • still only shows valid autocomplete entries for fragment spread
  • also exposes a documentAST of the current operation in onEditQuery and in the fetcher
  • concatenate fragments in codemirror for linting

todo:

  • code completion for GraphiQL, monaco-graphql, codemirror-graphql
  • operation execution
  • validation
  • test coverage

acao added 2 commits January 4, 2021 16:33
allows external, implied fragments in autocompletion, validation, and operation execution
@acao acao force-pushed the feat/external-fragments branch from 864a7bb to 19dac51 Compare January 6, 2021 17:45
@codecov
Copy link

codecov bot commented Jan 6, 2021

Codecov Report

Merging #1750 (dd2073a) into main (4038cf2) will decrease coverage by 0.79%.
The diff coverage is 36.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1750      +/-   ##
==========================================
- Coverage   57.83%   57.04%   -0.80%     
==========================================
  Files          30       32       +2     
  Lines        1537     1583      +46     
  Branches      288      297       +9     
==========================================
+ Hits          889      903      +14     
- Misses        566      597      +31     
- Partials       82       83       +1     
Impacted Files Coverage Δ
...ge-service-interface/src/GraphQLLanguageService.ts 9.64% <0.00%> (+0.08%) ⬆️
...ervice-interface/src/getAutocompleteSuggestions.ts 58.94% <0.00%> (+0.29%) ⬆️
...guage-service-interface/src/getHoverInformation.ts 3.06% <ø> (ø)
...language-service-utils/src/getASTNodeAtPosition.ts 18.75% <ø> (ø)
...language-service-utils/src/fragmentDependencies.ts 12.50% <12.50%> (ø)
...l-language-service-interface/src/getDiagnostics.ts 69.56% <14.28%> (-6.25%) ⬇️
...ql-language-service-interface/src/getDefinition.ts 11.90% <50.00%> (ø)
packages/codemirror-graphql/src/hint.js 95.00% <100.00%> (+0.26%) ⬆️
packages/codemirror-graphql/src/lint.js 100.00% <100.00%> (ø)
...mirror-graphql/src/utils/getFragmentDefinitions.js 100.00% <100.00%> (ø)
... and 5 more

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 4038cf2...dd2073a. Read the comment docs.

@acao acao force-pushed the feat/external-fragments branch from 099b0b4 to bb93abc Compare January 6, 2021 18:30
@acao acao marked this pull request as ready for review January 6, 2021 18:33
@acao
Copy link
Member Author

acao commented Jan 7, 2021

@sgrove note this change introduces use of internally and exposes a single AST document, that only changes on editor or props-driven query change. it's been added to onEditQuery and to the fetcher params. anywhere else that something like this would be handy for your plugin needs?

@acao acao merged commit cfed265 into main Jan 7, 2021
@acao acao deleted the feat/external-fragments branch January 7, 2021 15:39
@acao acao changed the title feat: implied or external fragments, resolves #612 feat: implied or external fragments, for #612 Jan 7, 2021
@github-actions github-actions bot mentioned this pull request Apr 1, 2021
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.

Plugin: Gatsby-style implicit fragments
1 participant