graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

feat: provide intellisense for Vue SFC files

Open AumyF opened this issue 3 years ago • 15 comments

This pull request enables intellisense for GraphQL templates in <script> and <script setup> in .vue SFC files.

Example

<script setup lang="ts">
// graphql-codegen uses the query to generate some code
`#graphql
query {id}
`;
</script>

AumyF avatar May 08 '22 06:05 AumyF

⚠️ No Changeset found

Latest commit: 9d0d741782fe06677184c75e650057a7ee463769

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar May 08 '22 06:05 changeset-bot[bot]

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: AumyF / name: Fukuda, Yuma (811e06c5a4d309cb4ae7fcc4c9ed71644c99cf80)

so exciting @AumyF !! thanks for doing this!

@stonexer would you like to help review this as you have time?

acao avatar May 13 '22 09:05 acao

Codecov Report

Merging #2391 (5c6cebd) into main (2d91916) will increase coverage by 3.93%. The diff coverage is 23.84%.

:exclamation: Current head 5c6cebd differs from pull request most recent head 9d0d741. Consider uploading reports for the commit 9d0d741 to get more accurate results

@@            Coverage Diff             @@
##             main    #2391      +/-   ##
==========================================
+ Coverage   65.70%   69.63%   +3.93%     
==========================================
  Files          85       72      -13     
  Lines        5106     4298     -808     
  Branches     1631     1442     -189     
==========================================
- Hits         3355     2993     -362     
+ Misses       1747     1300     -447     
- Partials        4        5       +1     
Impacted Files Coverage Δ
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
packages/codemirror-graphql/src/utils/hintList.ts 95.65% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql-react/src/editor/whitespace.ts 100.00% <ø> (ø)
packages/graphiql-react/src/utility/debounce.ts 0.00% <0.00%> (ø)
packages/graphiql-react/src/editor/tabs.ts 5.66% <5.66%> (ø)
packages/codemirror-graphql/src/variables/lint.ts 47.61% <66.66%> (+0.63%) :arrow_up:
packages/codemirror-graphql/src/hint.ts 94.73% <100.00%> (ø)
... and 100 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 5827977...9d0d741. Read the comment docs.

codecov[bot] avatar May 16 '22 14:05 codecov[bot]

@AumyF it still wants you to sign the CLA, are you able to?

acao avatar May 22 '22 06:05 acao

@AumyF anything I can do to help you finish this PR?

acao avatar Jun 09 '22 07:06 acao

@AumyF the issue with EasyCLA is easily fixable. You just need to sign the CLA using the email that all of your commits are signed with. Sorry for the boilerplate, your next PR will be much easier haha!

acao avatar Jul 24 '22 10:07 acao

@AumyF also can you add some tests? it might require a rebase, but we have some very specific tests now for findGraphQLTest that are very easy to write and run

acao avatar Jul 24 '22 12:07 acao

@AumyF I am going to revive this as a new PR. If you're able to sign the CLA with the same email the commits are signed with this weekend I can give you actual commit credit, but if not, I can give you a git username link attribution in the changelog. Unfortunately our CLA rules are quite strict and I might get in trouble for merging the work of someone who didn't pass the annoying but necessary CLA bot

acao avatar Jul 30 '22 18:07 acao

I'm sorry for the late reply. I have signed the CLA but I did with a different email address... The signature is invalid, isn't it?

And I finally got my motivation back, so, may I resume the pull request?

AumyF avatar Jul 30 '22 19:07 AumyF

@AumyF it would be an honor! This is a fantastic pull request you have here, and I'd be happy to help you see it through. Also, take as much time as you need. I plan to get a release out by tomorrow or monday at latest, but if for whatever reason you need longer let me know, we can always release this support in a patch version as a very welcome bonus for the new minor version of vscode-graphql, and a major improvement all around for editors

as per the CLA, you can re-sign the CLA using the email address you did use for every commit originally.

another option, if you prefer not to have to sign the form again, you can perform a git rebase -i however you prefer in such a way as to rewrite the email addresses used in the commits to use the email address you originally signed the CLA with.

acao avatar Jul 30 '22 20:07 acao

I rebased onto latest main and added some commits (I will squash them later)

AumyF avatar Jul 31 '22 09:07 AumyF

@AumyF thank you sooo much! this is so exciting. looks like the very picky CLA bot is finally happy!! 😆

acao avatar Jul 31 '22 10:07 acao

@AumyF I tried pushing a rebase but it says it's rejected, I wonder what I'm doing wrong? hmm!

acao avatar Aug 24 '22 19:08 acao

Screenshot 2022-08-24 at 21 40 20 even without --force! hmm!

acao avatar Aug 24 '22 19:08 acao

What's the status of this PR? I would love to have support for vue, so thanks a lot @AumyF for your work on this.

For the record, this should fix #1678.

tobiasdiez avatar Oct 20 '22 20:10 tobiasdiez

@tobiasdiez it is only missing a rebase! I was hoping to merge this after workspaces support, but I may release this first because we had to revert workspaces

acao avatar Oct 21 '22 16:10 acao

@tobiasdiez #2827 will be the one - I'm not able to push the rebase to the PR, so I've re-created it.

acao avatar Oct 22 '22 16:10 acao