vscode-apollo 1.19.3 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/config.json +14 -0
  3. package/.circleci/config.yml +82 -0
  4. package/.eslintrc.js +10 -0
  5. package/.gitattributes +1 -0
  6. package/.github/workflows/release.yml +95 -0
  7. package/.gitleaks.toml +26 -0
  8. package/.nvmrc +1 -0
  9. package/.prettierrc +5 -0
  10. package/.vscode/launch.json +61 -0
  11. package/.vscode/settings.json +16 -0
  12. package/.vscode/tasks.json +18 -0
  13. package/.vscodeignore +17 -1
  14. package/CHANGELOG.md +172 -1
  15. package/LICENSE +2 -2
  16. package/README.md +9 -9
  17. package/codegen.yml +12 -0
  18. package/images/IconRun.svg +8 -0
  19. package/jest.config.ts +11 -0
  20. package/package.json +102 -22
  21. package/renovate.json +23 -0
  22. package/src/__mocks__/fs.js +3 -0
  23. package/src/__tests__/statusBar.test.ts +8 -7
  24. package/src/debug.ts +2 -5
  25. package/src/env/fetch/fetch.ts +32 -0
  26. package/src/env/fetch/global.ts +30 -0
  27. package/src/env/fetch/index.d.ts +2 -0
  28. package/src/env/fetch/index.ts +2 -0
  29. package/src/env/fetch/url.ts +9 -0
  30. package/src/env/index.ts +4 -0
  31. package/src/env/polyfills/array.ts +17 -0
  32. package/src/env/polyfills/index.ts +2 -0
  33. package/src/env/polyfills/object.ts +7 -0
  34. package/src/env/typescript-utility-types.ts +2 -0
  35. package/src/extension.ts +106 -37
  36. package/src/language-server/__tests__/diagnostics.test.ts +86 -0
  37. package/src/language-server/__tests__/document.test.ts +187 -0
  38. package/src/language-server/__tests__/fileSet.test.ts +46 -0
  39. package/src/language-server/__tests__/fixtures/starwarsSchema.ts +1917 -0
  40. package/src/language-server/config/__tests__/config.ts +128 -0
  41. package/src/language-server/config/__tests__/loadConfig.ts +508 -0
  42. package/src/language-server/config/__tests__/utils.ts +106 -0
  43. package/src/language-server/config/config.ts +219 -0
  44. package/src/language-server/config/index.ts +3 -0
  45. package/src/language-server/config/loadConfig.ts +228 -0
  46. package/src/language-server/config/utils.ts +56 -0
  47. package/src/language-server/diagnostics.ts +109 -0
  48. package/src/language-server/document.ts +277 -0
  49. package/src/language-server/engine/GraphQLDataSource.ts +124 -0
  50. package/src/language-server/engine/index.ts +105 -0
  51. package/src/language-server/engine/operations/frontendUrlRoot.ts +7 -0
  52. package/src/language-server/engine/operations/schemaTagsAndFieldStats.ts +24 -0
  53. package/src/language-server/errors/__tests__/NoMissingClientDirectives.test.ts +220 -0
  54. package/src/language-server/errors/logger.ts +58 -0
  55. package/src/language-server/errors/validation.ts +277 -0
  56. package/src/language-server/fileSet.ts +65 -0
  57. package/src/language-server/format.ts +48 -0
  58. package/src/language-server/graphqlTypes.ts +7176 -0
  59. package/src/language-server/index.ts +29 -0
  60. package/src/language-server/languageProvider.ts +798 -0
  61. package/src/language-server/loadingHandler.ts +64 -0
  62. package/src/language-server/project/base.ts +399 -0
  63. package/src/language-server/project/client.ts +602 -0
  64. package/src/language-server/project/defaultClientSchema.ts +45 -0
  65. package/src/language-server/project/service.ts +48 -0
  66. package/src/language-server/providers/schema/__tests__/file.ts +150 -0
  67. package/src/language-server/providers/schema/base.ts +15 -0
  68. package/src/language-server/providers/schema/endpoint.ts +157 -0
  69. package/src/language-server/providers/schema/engine.ts +197 -0
  70. package/src/language-server/providers/schema/file.ts +167 -0
  71. package/src/language-server/providers/schema/index.ts +75 -0
  72. package/src/language-server/server.ts +252 -0
  73. package/src/language-server/typings/codemirror.d.ts +4 -0
  74. package/src/language-server/typings/graphql.d.ts +27 -0
  75. package/src/language-server/utilities/__tests__/graphql.test.ts +411 -0
  76. package/src/language-server/utilities/__tests__/uri.ts +55 -0
  77. package/src/language-server/utilities/debouncer.ts +8 -0
  78. package/src/language-server/utilities/debug.ts +89 -0
  79. package/src/language-server/utilities/graphql.ts +432 -0
  80. package/src/language-server/utilities/index.ts +3 -0
  81. package/src/language-server/utilities/source.ts +182 -0
  82. package/src/language-server/utilities/uri.ts +19 -0
  83. package/src/language-server/workspace.ts +262 -0
  84. package/src/languageServerClient.ts +19 -12
  85. package/src/messages.ts +84 -0
  86. package/src/statusBar.ts +5 -5
  87. package/src/tools/__tests__/buildServiceDefinition.test.ts +491 -0
  88. package/src/tools/__tests__/snapshotSerializers/astSerializer.ts +19 -0
  89. package/src/tools/__tests__/snapshotSerializers/graphQLTypeSerializer.ts +14 -0
  90. package/src/tools/buildServiceDefinition.ts +241 -0
  91. package/src/tools/index.ts +6 -0
  92. package/src/tools/schema/index.ts +2 -0
  93. package/src/tools/schema/resolveObject.ts +18 -0
  94. package/src/tools/schema/resolverMap.ts +23 -0
  95. package/src/tools/utilities/graphql.ts +22 -0
  96. package/src/tools/utilities/index.ts +3 -0
  97. package/src/tools/utilities/invariant.ts +5 -0
  98. package/src/tools/utilities/predicates.ts +5 -0
  99. package/src/utils.ts +1 -16
  100. package/syntaxes/graphql.js.json +3 -3
  101. package/syntaxes/graphql.json +13 -9
  102. package/syntaxes/graphql.lua.json +51 -0
  103. package/syntaxes/graphql.rb.json +1 -1
  104. package/tsconfig.build.json +4 -0
  105. package/tsconfig.json +20 -7
  106. package/create-server-symlink.js +0 -8
  107. package/lib/debug.d.ts +0 -11
  108. package/lib/debug.d.ts.map +0 -1
  109. package/lib/debug.js +0 -48
  110. package/lib/debug.js.map +0 -1
  111. package/lib/extension.d.ts +0 -4
  112. package/lib/extension.d.ts.map +0 -1
  113. package/lib/extension.js +0 -187
  114. package/lib/extension.js.map +0 -1
  115. package/lib/languageServerClient.d.ts +0 -4
  116. package/lib/languageServerClient.d.ts.map +0 -1
  117. package/lib/languageServerClient.js +0 -57
  118. package/lib/languageServerClient.js.map +0 -1
  119. package/lib/statusBar.d.ts +0 -24
  120. package/lib/statusBar.d.ts.map +0 -1
  121. package/lib/statusBar.js +0 -46
  122. package/lib/statusBar.js.map +0 -1
  123. package/lib/testRunner/index.d.ts +0 -3
  124. package/lib/testRunner/index.d.ts.map +0 -1
  125. package/lib/testRunner/index.js +0 -49
  126. package/lib/testRunner/index.js.map +0 -1
  127. package/lib/testRunner/jest-config.d.ts +0 -14
  128. package/lib/testRunner/jest-config.d.ts.map +0 -1
  129. package/lib/testRunner/jest-config.js +0 -18
  130. package/lib/testRunner/jest-config.js.map +0 -1
  131. package/lib/testRunner/jest-vscode-environment.d.ts +0 -2
  132. package/lib/testRunner/jest-vscode-environment.d.ts.map +0 -1
  133. package/lib/testRunner/jest-vscode-environment.js +0 -19
  134. package/lib/testRunner/jest-vscode-environment.js.map +0 -1
  135. package/lib/testRunner/jest-vscode-framework-setup.d.ts +0 -1
  136. package/lib/testRunner/jest-vscode-framework-setup.d.ts.map +0 -1
  137. package/lib/testRunner/jest-vscode-framework-setup.js +0 -3
  138. package/lib/testRunner/jest-vscode-framework-setup.js.map +0 -1
  139. package/lib/testRunner/vscode-test-script.d.ts +0 -2
  140. package/lib/testRunner/vscode-test-script.d.ts.map +0 -1
  141. package/lib/testRunner/vscode-test-script.js +0 -23
  142. package/lib/testRunner/vscode-test-script.js.map +0 -1
  143. package/lib/utils.d.ts +0 -18
  144. package/lib/utils.d.ts.map +0 -1
  145. package/lib/utils.js +0 -52
  146. package/lib/utils.js.map +0 -1
  147. package/src/testRunner/README.md +0 -23
  148. package/src/testRunner/index.ts +0 -72
  149. package/src/testRunner/jest-config.ts +0 -17
  150. package/src/testRunner/jest-vscode-environment.ts +0 -25
  151. package/src/testRunner/jest-vscode-framework-setup.ts +0 -10
  152. package/src/testRunner/jest.d.ts +0 -37
  153. package/src/testRunner/vscode-test-script.ts +0 -38
  154. package/tsconfig.test.json +0 -4
  155. package/tsconfig.tsbuildinfo +0 -2486
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3
+ "changelog": [
4
+ "@changesets/changelog-github",
5
+ { "repo": "apollographql/vscode-graphql" }
6
+ ],
7
+ "commit": false,
8
+ "fixed": [],
9
+ "linked": [],
10
+ "access": "public",
11
+ "baseBranch": "main",
12
+ "updateInternalDependencies": "patch",
13
+ "ignore": []
14
+ }
@@ -0,0 +1,82 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ secops: apollo/circleci-secops-orb@2.0.0
5
+
6
+ executors:
7
+ node:
8
+ docker:
9
+ - image: circleci/node:12.16.1-browsers
10
+ working_directory: ~/vscode-graphql
11
+
12
+ commands:
13
+ npm-install:
14
+ steps:
15
+ - restore_cache:
16
+ name: Restore npm cache
17
+ keys:
18
+ - npm-packages-{{ checksum "package-lock.json" }}--{{ checksum ".circleci/config.yml" }}
19
+ - run:
20
+ name: Install dependencies
21
+ command: npm ci --prefer-offline
22
+ - save_cache:
23
+ name: Save npm cache
24
+ key: npm-packages-{{ checksum "package-lock.json" }}--{{ checksum ".circleci/config.yml" }}
25
+ paths:
26
+ - ~/.npm
27
+
28
+ jobs:
29
+ lint:
30
+ executor: node
31
+ steps:
32
+ - checkout
33
+ - npm-install
34
+ - run:
35
+ name: Ensure test reports output dir exists
36
+ command: mkdir -p /tmp/test-reports/lint
37
+ - run:
38
+ name: Run lint (currenty prettier)
39
+ command: npm run lint -- --format junit --output-file /tmp/test-reports/lint/results.xml
40
+ - store_test_results:
41
+ path: /tmp/test-reports
42
+
43
+ typescript:
44
+ executor: node
45
+ steps:
46
+ - checkout
47
+ - npm-install
48
+ - run:
49
+ name: TypeScript Check
50
+ command: npm run typecheck
51
+
52
+ test-unit:
53
+ executor: node
54
+ steps:
55
+ - checkout
56
+ - npm-install
57
+ - run:
58
+ name: Ensure test reports output dir exists
59
+ command: mkdir -p /tmp/test-reports/test-unit
60
+ - run:
61
+ name: Test Unit
62
+ command: npm run test-unit -- --ci --reporters=jest-junit
63
+ environment:
64
+ JEST_JUNIT_OUTPUT_DIR: "/tmp/test-reports/test-unit"
65
+ - store_test_results:
66
+ path: /tmp/test-reports
67
+
68
+ workflows:
69
+ build-test-deploy:
70
+ jobs:
71
+ - lint
72
+ - typescript
73
+ - test-unit
74
+ security-scans:
75
+ jobs:
76
+ - secops/gitleaks:
77
+ context:
78
+ - platform-docker-ro
79
+ - github-orb
80
+ - secops-oidc
81
+ git-base-revision: <<#pipeline.git.base_revision>><<pipeline.git.base_revision>><</pipeline.git.base_revision >>
82
+ git-revision: << pipeline.git.revision >>
package/.eslintrc.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ parser: "@typescript-eslint/parser",
3
+ plugins: ["prettier", "@typescript-eslint"],
4
+ // Skip generated file.
5
+ ignorePatterns: ["src/language-server/graphqlTypes.ts"],
6
+ rules: {
7
+ "prettier/prettier": "error",
8
+ },
9
+ extends: ["prettier"],
10
+ };
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ package-lock.json -diff
@@ -0,0 +1,95 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ concurrency: ${{ github.workflow }}-${{ github.ref }}
9
+
10
+ jobs:
11
+ release:
12
+ name: Changesets Release
13
+ # Prevents action from creating a PR on forks
14
+ if: github.repository == 'apollographql/vscode-graphql'
15
+ runs-on: ubuntu-latest
16
+ # Permissions necessary for Changesets to push a new branch and open PRs
17
+ # (for automated Version Packages PRs), and request the JWT for provenance.
18
+ # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
19
+ permissions:
20
+ contents: write
21
+ pull-requests: write
22
+ id-token: write
23
+ steps:
24
+ - name: Checkout repo
25
+ uses: actions/checkout@v4
26
+ with:
27
+ # Fetch entire git history so Changesets can generate changelogs
28
+ # with the correct commits
29
+ fetch-depth: 0
30
+
31
+ - name: Check for pre.json file existence
32
+ id: check_files
33
+ uses: andstor/file-existence-action@v2.0.0
34
+ with:
35
+ files: ".changeset/pre.json"
36
+
37
+ - name: Append NPM token to .npmrc
38
+ run: |
39
+ cat << EOF > "$HOME/.npmrc"
40
+ //registry.npmjs.org/:_authToken=$NPM_TOKEN
41
+ EOF
42
+ env:
43
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44
+
45
+ - name: Setup Node.js 18.x
46
+ uses: actions/setup-node@v3
47
+ with:
48
+ node-version: 18.x
49
+
50
+ - name: Install dependencies
51
+ run: npm ci
52
+
53
+ - name: Create release PR or publish to npm + GitHub
54
+ id: changesets
55
+ if: steps.check_files.outputs.files_exists == 'false'
56
+ uses: changesets/action@v1
57
+ with:
58
+ version: npm run changeset-version
59
+ publish: npm run changeset-publish
60
+ env:
61
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
63
+
64
+ - name: Publish to Visual Studio Marketplace
65
+ if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true'
66
+ uses: HaaLeo/publish-vscode-extension@v1
67
+ with:
68
+ pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
69
+ registryUrl: https://marketplace.visualstudio.com
70
+ baseContentUrl: https://raw.githubusercontent.com/apollographql/vscode-graphql
71
+
72
+ - name: Send a Slack notification on publish
73
+ if: steps.changesets.outcome == 'success' && steps.changesets.outputs.published == 'true'
74
+ id: slack
75
+ uses: slackapi/slack-github-action@v1.24.0
76
+ with:
77
+ # Slack channel id, channel name, or user id to post message
78
+ # See also: https://api.slack.com/methods/chat.postMessage#channels
79
+ # You can pass in multiple channels to post to by providing
80
+ # a comma-delimited list of channel IDs
81
+ channel-id: "C02J316U84V"
82
+ payload: |
83
+ {
84
+ "blocks": [
85
+ {
86
+ "type": "section",
87
+ "text": {
88
+ "type": "mrkdwn",
89
+ "text": "A new version of `vscode-apollo` was released: <https://github.com/apollographql/vscode-apollo/releases/tag/v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}|v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}> :rocket:"
90
+ }
91
+ }
92
+ ]
93
+ }
94
+ env:
95
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
package/.gitleaks.toml ADDED
@@ -0,0 +1,26 @@
1
+ # This file exists primarily to influence scheduled scans that Apollo runs of all repos in Apollo-managed orgs.
2
+ # This is an Apollo-Internal link, but more information about these scans is available here:
3
+ # https://apollographql.atlassian.net/wiki/spaces/SecOps/pages/81330213/Everything+Static+Application+Security+Testing#Scheduled-Scans.1
4
+ #
5
+ # Apollo is using Gitleaks (https://github.com/gitleaks/gitleaks) to run these scans.
6
+ # However, this file is not something that Gitleaks natively consumes. This file is an
7
+ # Apollo-convention. Prior to scanning a repo, Apollo merges
8
+ # our standard Gitleaks configuration (which is largely just the Gitleaks-default config) with
9
+ # this file if it exists in a repo. The combined config is then used to scan a repo.
10
+ #
11
+ # We did this because the natively-supported allowlisting functionality in Gitleaks didn't do everything we wanted
12
+ # or wasn't as robust as we needed. For example, one of the allowlisting options offered by Gitleaks depends on the line number
13
+ # on which a false positive secret exists to allowlist it. (https://github.com/gitleaks/gitleaks#gitleaksignore).
14
+ # This creates a fairly fragile allowlisting mechanism. This file allows us to leverage the full capabilities of the Gitleaks rule syntax
15
+ # to create allowlisting functionality.
16
+
17
+
18
+ [[ rules ]]
19
+ id = "generic-api-key"
20
+ [ rules.allowlist ]
21
+ commits = [
22
+ # This creates an allowlist for a UUID that was
23
+ # used as an identifier, but is not secret
24
+ # See https://github.com/apollographql/vscode-graphql/blob/a905280c143991b3fd675f8b4c3a7da277ccf095/packages/apollo-language-server/src/engine/index.ts#L86
25
+ "a905280c143991b3fd675f8b4c3a7da277ccf095"
26
+ ]
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v18
package/.prettierrc ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "useTabs": false,
4
+ "singleQuote": false
5
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "version": "0.2.0",
3
+ // List of configurations. Add new configurations or edit existing ones.
4
+ "configurations": [
5
+ {
6
+ "name": "Launch VS Code Extension",
7
+ "type": "extensionHost",
8
+ "request": "launch",
9
+ "preLaunchTask": "npm: watch",
10
+ "runtimeExecutable": "${execPath}",
11
+ "args": [
12
+ "--extensionDevelopmentPath=${workspaceRoot}"
13
+ ],
14
+ "stopOnEntry": false,
15
+ "sourceMaps": true,
16
+ "outFiles": ["${workspaceRoot}/lib/**/*.js"]
17
+ },
18
+ {
19
+ "name": "Attach to TS Server",
20
+ "type": "node",
21
+ "request": "attach",
22
+ "protocol": "inspector",
23
+ "port": 6009,
24
+ "sourceMaps": true
25
+ },
26
+ {
27
+ "name": "Extension Tests",
28
+ "type": "extensionHost",
29
+ "request": "launch",
30
+ "runtimeExecutable": "${execPath}",
31
+ "args": [
32
+ "--disable-extensions",
33
+ "--extensionDevelopmentPath=${workspaceFolder}",
34
+ ],
35
+ "outFiles": ["${workspaceFolder}/lib/**/*.js"],
36
+ "preLaunchTask": "npm: watch"
37
+ },
38
+ {
39
+ "name": "Attach to Test Debugger",
40
+ "type": "node",
41
+ "request": "attach",
42
+ "protocol": "inspector",
43
+ "port": 9001,
44
+ "sourceMaps": true
45
+ },
46
+ {
47
+ "name": "Attach to CLI Debugger",
48
+ "type": "node",
49
+ "request": "attach",
50
+ "protocol": "inspector",
51
+ "port": 9002,
52
+ "sourceMaps": true
53
+ }
54
+ ],
55
+ "compounds": [
56
+ {
57
+ "name": "Extension + Server",
58
+ "configurations": ["Launch VS Code Extension", "Attach to TS Server"]
59
+ }
60
+ ]
61
+ }
@@ -0,0 +1,16 @@
1
+ // Place your settings in this file to overwrite default and user settings.
2
+ {
3
+ "editor.tabSize": 2,
4
+ "editor.insertSpaces": true,
5
+ "editor.rulers": [110],
6
+ "editor.wordWrapColumn": 110,
7
+ "files.trimTrailingWhitespace": true,
8
+ "files.insertFinalNewline": true,
9
+ "files.exclude": {
10
+ "**/.git": true,
11
+ "**/.DS_Store": true,
12
+ "node_modules": false
13
+ },
14
+ "typescript.tsdk": "node_modules/typescript/lib",
15
+ "debug.node.autoAttach": "on"
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "type": "npm",
6
+ "script": "watch",
7
+ "problemMatcher": "$tsc-watch",
8
+ "isBackground": true,
9
+ "presentation": {
10
+ "reveal": "never"
11
+ },
12
+ "group": {
13
+ "kind": "build",
14
+ "isDefault": true
15
+ }
16
+ }
17
+ ]
18
+ }
package/.vscodeignore CHANGED
@@ -1 +1,17 @@
1
- lib/testRunner/**
1
+ .circleci
2
+ .vscode
3
+ .vscode-test
4
+ src
5
+ .env
6
+ .eslintrc.js
7
+ .git
8
+ .gitignore
9
+ .nvmrc
10
+ .prettierrc
11
+ .gitattributes
12
+ codegen.yml
13
+ graphql.configuration.json
14
+ jest.config.ts
15
+ package-lock.json
16
+ tsconfig.build.json
17
+ tsconfig.json
package/CHANGELOG.md CHANGED
@@ -1 +1,172 @@
1
- To see release notes and changes for `vscode-apollo`, See the [apollo-tooling changelog](https://github.com/apollographql/apollo-tooling/blob/master/CHANGELOG.md)
1
+ # CHANGELOG
2
+
3
+ ## 1.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#105](https://github.com/apollographql/vscode-graphql/pull/105) [`43879da4`](https://github.com/apollographql/vscode-graphql/commit/43879da40f3a3b7c6327cf165fca9980e04b4bc7) Thanks [@zovits](https://github.com/zovits)! - Add inline syntax highlighting support for Lua
8
+
9
+ ### Patch Changes
10
+
11
+ - [#99](https://github.com/apollographql/vscode-graphql/pull/99) [`2a3fc1bb`](https://github.com/apollographql/vscode-graphql/commit/2a3fc1bb3c38245f09a5e5e0a19900ea0cfc58b3) Thanks [@pvinis](https://github.com/pvinis)! - Support tagging inside of parentheses
12
+
13
+ - [#73](https://github.com/apollographql/vscode-graphql/pull/73) [`d07b303d`](https://github.com/apollographql/vscode-graphql/commit/d07b303d31fdf0810f8be163bb3973c564cf0754) Thanks [@rachsmithcodes](https://github.com/rachsmithcodes)! - Return early instead of erroring on missing fields
14
+
15
+ - [#97](https://github.com/apollographql/vscode-graphql/pull/97) [`2b57a1af`](https://github.com/apollographql/vscode-graphql/commit/2b57a1afd9882a139a47af9b55496b7aa62fde2b) Thanks [@clf17222592](https://github.com/clf17222592)! - Support configuration files with .cjs file extension
16
+
17
+ - [#78](https://github.com/apollographql/vscode-graphql/pull/78) [`8b02374a`](https://github.com/apollographql/vscode-graphql/commit/8b02374a355ef9304e1fe9b0d89bcf559e618428) Thanks [@jtgrenz](https://github.com/jtgrenz)! - Fix regex for ruby heredoc
18
+
19
+ ### 1.19.11
20
+
21
+ - Fix directive highlighting on enums and arguments [#6716](https://github.com/apollographql/vscode-graphql/pull/71)
22
+
23
+ ### 1.19.10
24
+
25
+ - Fix highlighting on schema extension directives [#66](https://github.com/apollographql/vscode-graphql/pull/66)
26
+
27
+ ### 1.19.9
28
+
29
+ - Add validation/completion for #graphql annotated strings in js [#47](https://github.com/apollographql/vscode-graphql/pull/47)
30
+ - Add config option for disabling 'Run in Studio' button [#46](https://github.com/apollographql/vscode-graphql/pull/46)
31
+ - Add config option to disable switching to output tab on error [#44](https://github.com/apollographql/vscode-graphql/pull/44)
32
+
33
+ ### 1.19.8
34
+
35
+ - Move 'Run in Studio' icon to end of line [#42](https://github.com/apollographql/vscode-graphql/pull/42)
36
+ - Fix syntax highlighting for directives on types [#36](https://github.com/apollographql/vscode-graphql/pull/36)
37
+
38
+ ### 1.19.7
39
+
40
+ - Specify files with conflicting documents for the 'There are multiple definitions' message. [#29](https://github.com/apollographql/vscode-graphql/pull/29)
41
+ - Dont watch non file documents. Diff view will no longer crash extension. [#28](https://github.com/apollographql/vscode-graphql/pull/28)
42
+ - Upgrade graphql version to 15.5 [#34](https://github.com/apollographql/vscode-graphql/pull/34)
43
+
44
+ ### 1.19.6
45
+
46
+ - Fix 'Run in explorer' link. [#25](https://github.com/apollographql/vscode-graphql/pull/25)
47
+
48
+ ### 1.19.5
49
+
50
+ - Add a 'Run in explorer' gutter action. [#20](https://github.com/apollographql/vscode-graphql/pull/20)
51
+ - Switch Studio query that fetches timing hints to use a newer field. This should have no user-observable impact, though we may eventually remove the old field once most users have upgraded their extensions. [#22](https://github.com/apollographql/vscode-graphql/pull/22)
52
+ - Add support for highlighting Svelte files [#17](https://github.com/apollographql/vscode-graphql/pull/17)
53
+ - Add support for `.cjs` files [#4](https://github.com/apollographql/vscode-graphql/pull/4)
54
+ - Exclude localSchemaFile when looking for graphql documents. This should fix the common case for hitting `VSCode Plugin: Loading Schema Twice` errors. [#8](https://github.com/apollographql/vscode-graphql/pull/8)
55
+
56
+ ### 1.19.4
57
+
58
+ - Fix VS Code extension performance issues for larger projects [#1938](https://github.com/apollographql/apollo-tooling/pull/1938)
59
+
60
+ -> _Note:_ This project used to live in the [apollo-tooling](https://github.com/apollographql/apollo-tooling) repo. Refer to the [apollo-tooling CHANGELOG](https://github.com/apollographql/apollo-tooling/blob/master/CHANGELOG.md) for full list of changes before April 25, 2021. See below for filtered changelog from apollo-tooling.
61
+
62
+ ## Legacy apollo-tooling Changelog
63
+
64
+ ### apollo-tools@0.5.1
65
+
66
+ - Remove dependency on `apollo-env`, so using this package no longer installs polyfills.
67
+
68
+ ### apollo-env@0.10.0
69
+
70
+ - deps: Updated `node-fetch` to v2.6.1
71
+
72
+ ### apollo-env@0.9.0
73
+
74
+ - The following utility functions are no longer exported from `apollo-env` and can now be found in the `apollo-graphql` library:
75
+ - `createHash`
76
+ - `isNodeLike`
77
+ - `mapValues`
78
+ - `isNotNullOrDefined`
79
+
80
+ ### `apollo-language-server@1.14.3`
81
+
82
+ - `apollo-language-server@1.14.3`
83
+ - Fix issue where fragment definitions only included in `@client` fields would not be stripped ((AP-682)(https://golinks.io/AP-682), [#1454](https://github.com/apollographql/apollo-tooling/pull/1454))
84
+
85
+ ### `apollo-language-server@1.14.2`
86
+
87
+ - `apollo-language-server@1.14.2`
88
+ - Fix #735 caused #928 error implement [#1461](https://github.com/apollographql/apollo-tooling/pull/1461)
89
+ - Fix dirname parsing for ts config files [#1463](https://github.com/apollographql/apollo-tooling/pull/1463)
90
+
91
+ ### `vscode-apollo@1.9.1`, `apollo-language-server@1.14.1`
92
+
93
+ - `apollo-language-server@1.14.1`
94
+ - Fix cache invalidation bug for reload schema which caused outdated results in autocomplete [#1446](https://github.com/apollographql/apollo-tooling/pull/1446)
95
+
96
+ ### `vscode-apollo@1.9.0`, `apollo-language-server@1.14.0`, `apollo-codegen-swift@0.34.2`
97
+
98
+ - `vscode-apollo@1.9.0`
99
+ - Add Dart support for vscode [#1385](https://github.com/apollographql/apollo-tooling/pull/1385)
100
+ - `apollo-language-server@1.14.0`
101
+ - Add Dart operation extraction [#1385](https://github.com/apollographql/apollo-tooling/pull/1385)
102
+ - `apollo-codegen-swift@0.34.2`
103
+ - Prevent compiler warnings for redundant access-level modifiers when using `--namespace` [1241](https://github.com/apollographql/apollo-tooling/pull/1241)
104
+
105
+ ### `apollo-language-server@1.5.2`, `vscode-apollo@1.5.2`
106
+
107
+ - `apollo-language-server@1.5.2`
108
+ - fix single apollo.config breaking others loaded at the same time [#1055](https://github.com/apollographql/apollo-tooling/pull/1055)
109
+ - Fix broken fileSet.includesFile to use full filepath [#1055](https://github.com/apollographql/apollo-tooling/pull/1055)
110
+ - `vscode-apollo@1.5.2`
111
+
112
+ ### `apollo-env@0.3.1`
113
+
114
+ - `apollo-env@0.3.1`
115
+ - Fix core-js dependency by pinning to `3.0.0-beta.3` [#961](https://github.com/apollographql/apollo-tooling/pull/961)
116
+
117
+ ### `apollo-language-server@1.4.1`
118
+
119
+ - `apollo-language-server` 1.4.1
120
+ - Fix edge case for empty operations [#959](https://github.com/apollographql/apollo-tooling/pull/959)
121
+
122
+ ### `apollo-language-server@1.0.0`
123
+
124
+ > NOTE: Many of the updates and changes in this release came from a complete rebuild of the Apollo CLI in preparation for GraphQL summit. Many of these changes can be traced to [this commit](https://github.com/apollographql/apollo-tooling/commit/d2d73f9c597845355b7ee267e411d80d1c493043) but aren't tied to a specific pull request, and won't be linked.
125
+
126
+ - `apollo-language-server@1.0.0`
127
+ - Initial release of `apollo-language-server` to support `vscode-apollo`, and `apollo`
128
+ - Supports editor features for...
129
+ - Autocompletion of GraphQL documents
130
+ - Hover information for fields anr arguments
131
+ - Type definitions and references
132
+ - Code lenses for open files
133
+ - `vscode-apollo@1.0.0`
134
+ - Initial Release of `vscode-apollo`
135
+ - Switching of schema tags [#632](https://github.com/apollographql/apollo-tooling/pull/632)
136
+ - Supports all of the editor features exposed by `apollo-language-server`
137
+
138
+ #### :rocket: Feature
139
+
140
+ - `apollo-language-server`, `apollo-vscode`
141
+ - [#536](https://github.com/apollographql/apollo-tooling/pull/536) Display status of loading tasks for config and Engine stats ([@shadaj](https://github.com/shadaj))
142
+
143
+ #### :bug: Bug Fix
144
+
145
+ - `apollo-cli`, `apollo-language-server`, `apollo-vscode`
146
+ - [#519](https://github.com/apollographql/apollo-tooling/pull/519) [VSCode] Fix detection of projects inside folders ([@shadaj](https://github.com/shadaj))
147
+
148
+ #### :memo: Documentation
149
+
150
+ - `apollo-cli`, `apollo-vscode`
151
+ - [#521](https://github.com/apollographql/apollo-tooling/pull/521) Add README for the VS Code extension ([@shadaj](https://github.com/shadaj))
152
+
153
+ #### :rocket: Feature
154
+
155
+ - `apollo-language-server`
156
+ - [#516](https://github.com/apollographql/apollo-tooling/pull/516) Code complete default query variables ([@shadaj](https://github.com/shadaj))
157
+ - `apollo-language-server`, `apollo-vscode`
158
+ - [#515](https://github.com/apollographql/apollo-tooling/pull/515) Fix missing descriptions and add more hover information for arguments ([@shadaj](https://github.com/shadaj))
159
+ - `apollo-cli`, `apollo-codegen-core`, `apollo-language-server`, `apollo-vscode-webview`, `apollo-vscode`
160
+ - [#512](https://github.com/apollographql/apollo-tooling/pull/512) React UI for webviews, fix file tracking and fragment spreads ([@shadaj](https://github.com/shadaj))
161
+ - `apollo-cli`, `apollo-language-server`, `apollo-vscode`
162
+ - [#508](https://github.com/apollographql/apollo-tooling/pull/508) Support jumping to definitions in schema ([@shadaj](https://github.com/shadaj))
163
+
164
+ #### :house: Internal
165
+
166
+ - `apollo-cli`, `apollo-language-server`
167
+ - [#506](https://github.com/apollographql/apollo-tooling/pull/506) Share validation logic between CLI and language server ([@shadaj](https://github.com/shadaj))
168
+
169
+ #### :rocket: Feature
170
+
171
+ - `apollo-language-server`, `apollo-vscode`
172
+ - [#504](https://github.com/apollographql/apollo-tooling/pull/504) Add Apollo VS Code extension ([@shadaj](https://github.com/shadaj))
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2016 Meteor Development Group, Inc.
3
+ Copyright (c) 2021 Apollo GraphQL
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  GraphQL has the potential to create incredible developer experiences, thanks to its strongly typed schema and query language. The Apollo platform brings these possibilities to life by enhancing your editor with rich metadata from your graph API.
4
4
 
5
- ![demo](https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/jump-to-def.gif)
5
+ ![demo](https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/jump-to-def.gif)
6
6
 
7
7
  The Apollo GraphQL extension for VS Code brings an all-in-one tooling experience for developing apps with Apollo.
8
8
 
@@ -17,7 +17,7 @@ The Apollo GraphQL extension for VS Code brings an all-in-one tooling experience
17
17
 
18
18
  <h2 id="getting-started">Getting started</h2>
19
19
 
20
- Some features of this extension (like syntax highlighting) will work without any configuration, but to get all of the benefits of the VS Code experience, it's best to link the schema that is being developed against **before** installing the extension. The best way to do that is by [publishing a schema](https://www.apollographql.com/docs/platform/schema-registry.html#setup) to the Apollo schema registry. Once that is done, two steps are needed:
20
+ Some features of this extension (like syntax highlighting) will work without any configuration, but to get all of the benefits of the VS Code experience, it's best to link the schema that is being developed against **before** installing the extension. The best way to do that is by [publishing a schema](https://www.apollographql.com/docs/graphos/delivery/) to the Apollo schema registry. Once that is done, two steps are needed:
21
21
 
22
22
  1. Create an `apollo.config.js` at the root of the project
23
23
  2. Copy an API key from the Apollo Studio dashboard of the published graph
@@ -94,7 +94,7 @@ Once you have a config set up and a schema published, **install the Apollo Graph
94
94
 
95
95
  When a file open, clicking the status bar icon will open the output window and print stats about the project associated with that file. This is helpful when confirming the project is setup properly.
96
96
 
97
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/stats.gif" alt="Clicking the status bar icon to open the output pane">
97
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/stats.gif" alt="Clicking the status bar icon to open the output pane">
98
98
 
99
99
  <h2 id="features">Features</h2>
100
100
 
@@ -104,19 +104,19 @@ Apollo for VS Code brings many helpful features for working on a GraphQL project
104
104
 
105
105
  Once configured, VS Code has full knowledge of the schema clients are running operations against, including client-only schemas (for things like local state mutations). Because of this, it have the ability to autocomplete fields and arguments as you type.
106
106
 
107
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/autocomplete.gif" alt="vscode completing a field when typing">
107
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/autocomplete.gif" alt="vscode completing a field when typing">
108
108
 
109
109
  <h3 id="errors-and-warnings">Inline errors and warnings</h3>
110
110
 
111
111
  VS Code can use local or published schemas to validate operations before running them. **Syntax errors**, **invalid fields or arguments**, and even **deprecated fields** instantly appear as errors or warnings right in your editor, ensuring all developers are working with the most up-to-date production schemas.
112
112
 
113
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/warnings-and-errors.gif" alt="tooltip showing a field deprecation warning and error">
113
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/warnings-and-errors.gif" alt="tooltip showing a field deprecation warning and error">
114
114
 
115
115
  <h3 id="field-type-info">Inline field type information</h3>
116
116
 
117
117
  Because of GraphQL's strongly-typed schema, VS Code not only know about which fields and arguments are valid, but also what types are expected. Hover over any type in a valid GraphQL operation to see what type that field returns and whether or not it can be null.
118
118
 
119
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/type-info.png" style="max-width:800px;" alt="a tooltip showing a Boolean type for a field">
119
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/type-info.png" style="max-width:800px;" alt="a tooltip showing a Boolean type for a field">
120
120
 
121
121
  <h3 id="performance-insights">Performance insights</h3>
122
122
 
@@ -126,7 +126,7 @@ To turn on tracing for your GraphQL server, please visit our [guide](https://www
126
126
 
127
127
  The VS Code extension will show inline performance diagnostics when connected to a service with reported metrics in Apollo Studio. As operations are typed, any fields that take longer than 1ms to respond will be annotated to the right of the field inline! This gives team members a picture of how long the operation will take as more and more fields are added to operations or fragments.
128
128
 
129
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/perf-annotation.png" style="max-width:800px;" alt="Performance annotation next to a field">
129
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/perf-annotation.png" style="max-width:800px;" alt="Performance annotation next to a field">
130
130
 
131
131
  <h3 id="syntax">Syntax highlighting</h3>
132
132
 
@@ -136,7 +136,7 @@ Apollo's editor extension provides syntax highlighting for all things GraphQL, i
136
136
 
137
137
  Navigating large codebases can be difficult, but the Apollo GraphQL extension makes this easier than ever. Right-clicking on any field in operations or schemas gives you the ability to jump to (or peek at) definitions, as well as find any other references to that field in your project. Searching a project for any occurrence of a certain field is now a thing of the past!
138
138
 
139
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/jump-to-def.gif" alt="Using jump to definition on a fragment">
139
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/jump-to-def.gif" alt="Using jump to definition on a fragment">
140
140
 
141
141
  <h3 id="commands">Schema tag switching</h3>
142
142
 
@@ -151,6 +151,6 @@ Other errors may be caused from an old version of a published schema. To reload
151
151
 
152
152
  Sometimes errors will show up as a notification at the bottom of your editor. Other, less critical messages may be shown in the output pane of the editor. To open the output pane and get diagnostic information about the extension and the current service loaded (if working with a client project), just click the "Apollo GraphQL" icon in the status bar at the bottom.
153
153
 
154
- <img src="https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo/images/marketplace/stats.gif" alt="Clicking the status bar icon to open the output pane">
154
+ <img src="https://raw.githubusercontent.com/apollographql/vscode-graphql/main/images/marketplace/stats.gif" alt="Clicking the status bar icon to open the output pane">
155
155
 
156
156
  If problems persist or the error messages are unhelpful, an [issue](https://github.com/apollographql/apollo-tooling/issues) can be opened on the `apollo-tooling` repository.
package/codegen.yml ADDED
@@ -0,0 +1,12 @@
1
+ # Would be better to get the schema from the Studio registry once it can be a public variant.
2
+ schema: https://graphql.api.apollographql.com/api/graphql
3
+ generates:
4
+ ./src/language-server/graphqlTypes.ts:
5
+ documents:
6
+ - src/**/*.ts
7
+ - "!src/**/__tests__**/*.ts"
8
+ plugins:
9
+ - typescript
10
+ - typescript-operations
11
+ config:
12
+ avoidOptionals: true