vscode-apollo 2.5.6 → 2.6.1
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.
- package/.circleci/config.yml +17 -0
- package/.github/workflows/E2E.yml +3 -2
- package/.github/workflows/build-prs.yml +2 -1
- package/.github/workflows/release.yml +2 -2
- package/.prettierignore +3 -0
- package/.semgrepignore +2 -0
- package/.vscode/settings.json +7 -2
- package/CHANGELOG.md +12 -0
- package/apollo.connectors.mapping.configuration.json +10 -0
- package/package.json +38 -4
- package/sampleWorkspace/connectors-community/.github/ISSUE_TEMPLATE/connector-bug-report.md +36 -0
- package/sampleWorkspace/connectors-community/.github/ISSUE_TEMPLATE/new-connector.md +10 -0
- package/sampleWorkspace/connectors-community/.github/renovate.json5 +3 -0
- package/sampleWorkspace/connectors-community/.vscode/extensions.json +3 -0
- package/sampleWorkspace/connectors-community/.vscode/settings.json +13 -0
- package/sampleWorkspace/connectors-community/.vscode/tasks.json +10 -0
- package/sampleWorkspace/connectors-community/README.md +108 -0
- package/sampleWorkspace/connectors-community/apollo.config.json +5 -0
- package/sampleWorkspace/connectors-community/connectors/.template/Dockerfile +5 -0
- package/sampleWorkspace/connectors-community/connectors/.template/README +46 -0
- package/sampleWorkspace/connectors-community/connectors/.template/connector.graphql +31 -0
- package/sampleWorkspace/connectors-community/connectors/.template/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/.template/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/README +12 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/albums.graphql +48 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/comments.graphql +54 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/photos.graphql +54 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/posts.graphql +51 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/supergraph.yaml +26 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/todos.graphql +51 -0
- package/sampleWorkspace/connectors-community/connectors/JSONPlaceholder/users.graphql +80 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/README.md +9 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/TM-Forum/tmf622-ProductOrdering.graphql +296 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/README.md +7 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/addresses.graphql +30 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/customer.graphql +77 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/products.graphql +70 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/router.yaml +24 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/supergraph.yaml +14 -0
- package/sampleWorkspace/connectors-community/connectors/adobe-commerce-cloud/swagger.json +69226 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/Dockerfile +5 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/README +61 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/messages.graphql +258 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/anthropic/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/README +3 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/connector.graphql +38 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/apollo-ecomm-simple/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/apple/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/apple/app-store-connect.graphql +100 -0
- package/sampleWorkspace/connectors-community/connectors/apple/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/apple/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/aws/README +125 -0
- package/sampleWorkspace/connectors-community/connectors/aws/dynamodb.graphql +130 -0
- package/sampleWorkspace/connectors-community/connectors/aws/json-responses/product-price.json +10 -0
- package/sampleWorkspace/connectors-community/connectors/aws/json-responses/products.json +53 -0
- package/sampleWorkspace/connectors-community/connectors/aws/lambda.graphql +179 -0
- package/sampleWorkspace/connectors-community/connectors/aws/router.yaml +54 -0
- package/sampleWorkspace/connectors-community/connectors/aws/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/bored/README.md +35 -0
- package/sampleWorkspace/connectors-community/connectors/bored/bored.graphql +87 -0
- package/sampleWorkspace/connectors-community/connectors/bored/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/README.md +23 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/contacts.graphql +141 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/json-responses/members_email_.json +61 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/common-room/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/README.md +58 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/distancematrix.graphql +155 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/places-legacy.graphql +117 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/places.graphql +399 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/supergraph.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/googlemaps/timezone.graphql +64 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/README +105 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/avatars.graphql +79 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/photo-avatars.graphql +454 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/router.yaml +21 -0
- package/sampleWorkspace/connectors-community/connectors/heygen/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/jira/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/jira/connector.graphql +197 -0
- package/sampleWorkspace/connectors-community/connectors/jira/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/jira/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/museums/README.md +40 -0
- package/sampleWorkspace/connectors-community/connectors/museums/chicagoArt.graphql +150 -0
- package/sampleWorkspace/connectors-community/connectors/museums/met.graphql +119 -0
- package/sampleWorkspace/connectors-community/connectors/museums/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/nws/README.md +45 -0
- package/sampleWorkspace/connectors-community/connectors/nws/alerts.graphql +598 -0
- package/sampleWorkspace/connectors-community/connectors/nws/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/odata/README +18 -0
- package/sampleWorkspace/connectors-community/connectors/odata/connector.graphql +171 -0
- package/sampleWorkspace/connectors-community/connectors/odata/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/odata/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/openai/README.md +61 -0
- package/sampleWorkspace/connectors-community/connectors/openai/assistants.graphql +285 -0
- package/sampleWorkspace/connectors-community/connectors/openai/chat-completions.graphql +169 -0
- package/sampleWorkspace/connectors-community/connectors/openai/models.graphql +47 -0
- package/sampleWorkspace/connectors-community/connectors/openai/router.yaml +24 -0
- package/sampleWorkspace/connectors-community/connectors/openai/supergraph.yaml +14 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/README +45 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/games.graphql +70 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/locations.graphql +127 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/moves.graphql +107 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/pokemon.graphql +539 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/pokeapi/supergraph.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/README.md +75 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/router.yaml +19 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/strapi/users.graphql +227 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/README.md +83 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/checkout.graphql +112 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/core-resources.graphql +868 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/payment-methods.graphql +526 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/products.graphql +162 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/router.yaml +26 -0
- package/sampleWorkspace/connectors-community/connectors/stripe/supergraph.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/README.md +80 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/router.yaml +5 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/supabase.graphql +143 -0
- package/sampleWorkspace/connectors-community/connectors/supabase/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/README +46 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/agencies.graphql +193 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/api-throttle.graphql +33 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/astronauts.graphql +237 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/celestial-bodies.graphql +131 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/docking-events.graphql +3460 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/launches.graphql +1156 -0
- package/sampleWorkspace/connectors-community/connectors/thespacedevs/supergraph.yaml +77 -0
- package/sampleWorkspace/connectors-community/connectors/tint/README +35 -0
- package/sampleWorkspace/connectors-community/connectors/tint/accounts.graphql +69 -0
- package/sampleWorkspace/connectors-community/connectors/tint/router.yaml +21 -0
- package/sampleWorkspace/connectors-community/connectors/tint/social-feeds.graphql +62 -0
- package/sampleWorkspace/connectors-community/connectors/tint/supergraph.yaml +10 -0
- package/sampleWorkspace/connectors-community/connectors/todoist/README.md +48 -0
- package/sampleWorkspace/connectors-community/connectors/todoist/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/todoist/todoist.graphql +381 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/README +99 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/connector.graphql +66 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/trimblemaps/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/README.md +44 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/messages.graphql +107 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/router.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/twilio/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/README.md +44 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/earthquakes.graphql +235 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/README.md +44 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/earthquake-simple.graphql +87 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/router.yaml +3 -0
- package/sampleWorkspace/connectors-community/connectors/usgs/earthquakes-nominatum/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usps/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/usps/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/usps/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/connectors/usps/tracking.graphql +118 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/README +36 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/connector.graphql +98 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/router.yaml +18 -0
- package/sampleWorkspace/connectors-community/connectors/zendesk/supergraph.yaml +6 -0
- package/sampleWorkspace/connectors-community/file-new/index.js +520 -0
- package/sampleWorkspace/connectors-community/package-lock.json +119 -0
- package/sampleWorkspace/connectors-community/package.json +20 -0
- package/sampleWorkspace/connectors-community/supergraph.yaml +6 -0
- package/sampleWorkspace/sampleWorkspace.code-workspace +29 -8
- package/src/__tests__/fixtures/textmate/test.apollo.connectors.mapping +213 -0
- package/src/__tests__/fixtures/textmate/test.connect.graphql +104 -0
- package/src/language-server/__tests__/fixtures/documents/functionCall.ts.snap +3 -3
- package/syntaxes/build.ts +266 -0
- package/syntaxes/connectors.mapping.json +532 -0
- package/syntaxes/connectors.mapping.yaml +440 -0
- package/syntaxes/graphql.connectors.json +426 -0
- package/syntaxes/graphql.connectors.yaml +254 -0
- package/syntaxes/graphql.json +8 -1
- package/syntaxes/publish.sh +43 -0
- package/syntaxes/tsconfig.json +6 -0
package/.circleci/config.yml
CHANGED
|
@@ -8,6 +8,10 @@ executors:
|
|
|
8
8
|
docker:
|
|
9
9
|
- image: cimg/node:22.12.0
|
|
10
10
|
working_directory: ~/vscode-graphql
|
|
11
|
+
node24:
|
|
12
|
+
docker:
|
|
13
|
+
- image: cimg/node:24.4.0
|
|
14
|
+
working_directory: ~/vscode-graphql
|
|
11
15
|
|
|
12
16
|
commands:
|
|
13
17
|
npm-install:
|
|
@@ -53,12 +57,25 @@ jobs:
|
|
|
53
57
|
name: Test
|
|
54
58
|
command: npm run test -- --runInBand
|
|
55
59
|
|
|
60
|
+
textmate:
|
|
61
|
+
executor: node24
|
|
62
|
+
steps:
|
|
63
|
+
- checkout
|
|
64
|
+
- npm-install
|
|
65
|
+
- run:
|
|
66
|
+
name: Build TextMate Grammar
|
|
67
|
+
command: npm run build:textmate
|
|
68
|
+
- run:
|
|
69
|
+
name: Test TextMate Grammar
|
|
70
|
+
command: npm run test:textmate
|
|
71
|
+
|
|
56
72
|
workflows:
|
|
57
73
|
build-test-deploy:
|
|
58
74
|
jobs:
|
|
59
75
|
- lint
|
|
60
76
|
- typescript
|
|
61
77
|
- test
|
|
78
|
+
- textmate
|
|
62
79
|
security-scans:
|
|
63
80
|
jobs:
|
|
64
81
|
- secops/gitleaks:
|
|
@@ -5,7 +5,7 @@ on:
|
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
7
|
jobs:
|
|
8
|
-
|
|
8
|
+
e2e:
|
|
9
9
|
name: Run E2E tests
|
|
10
10
|
runs-on: "${{ matrix.os }}"
|
|
11
11
|
strategy:
|
|
@@ -22,7 +22,8 @@ jobs:
|
|
|
22
22
|
- uses: actions/setup-node@v4
|
|
23
23
|
with:
|
|
24
24
|
cache: "npm"
|
|
25
|
-
|
|
25
|
+
node-version: 24
|
|
26
|
+
- run: npm ci
|
|
26
27
|
- run: echo 'APOLLO_KEY="service:bob-123:489fhseo4"' > ./sampleWorkspace/spotifyGraph/.env
|
|
27
28
|
shell: bash
|
|
28
29
|
|
|
@@ -10,7 +10,8 @@ jobs:
|
|
|
10
10
|
- uses: actions/setup-node@v4
|
|
11
11
|
with:
|
|
12
12
|
cache: "npm"
|
|
13
|
-
|
|
13
|
+
node-version: 24
|
|
14
|
+
- run: npm ci
|
|
14
15
|
- run: echo PKG_VERSION="$(git show --no-patch --format=0.0.0-build-%ct.pr-${{ github.event.pull_request.number }}.commit-%h)" >> $GITHUB_ENV
|
|
15
16
|
- run: npm pkg set "version=${{ env.PKG_VERSION }}"
|
|
16
17
|
- run: npx -y @vscode/vsce package --out vscode-apollo-${{ env.PKG_VERSION }}.vsix
|
|
@@ -42,10 +42,10 @@ jobs:
|
|
|
42
42
|
env:
|
|
43
43
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
44
44
|
|
|
45
|
-
- name: Setup Node.js
|
|
45
|
+
- name: Setup Node.js 24.x
|
|
46
46
|
uses: actions/setup-node@v3
|
|
47
47
|
with:
|
|
48
|
-
node-version:
|
|
48
|
+
node-version: 24.x
|
|
49
49
|
|
|
50
50
|
- name: Install dependencies
|
|
51
51
|
run: npm ci
|
package/.prettierignore
CHANGED
package/.semgrepignore
ADDED
package/.vscode/settings.json
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
{
|
|
3
3
|
"editor.tabSize": 2,
|
|
4
4
|
"editor.insertSpaces": true,
|
|
5
|
-
"editor.rulers": [
|
|
5
|
+
"editor.rulers": [
|
|
6
|
+
110
|
|
7
|
+
],
|
|
6
8
|
"editor.wordWrapColumn": 110,
|
|
7
9
|
"files.trimTrailingWhitespace": true,
|
|
8
10
|
"files.insertFinalNewline": true,
|
|
@@ -12,5 +14,8 @@
|
|
|
12
14
|
"node_modules": false
|
|
13
15
|
},
|
|
14
16
|
"typescript.tsdk": "node_modules/typescript/lib",
|
|
15
|
-
"debug.node.autoAttach": "on"
|
|
17
|
+
"debug.node.autoAttach": "on",
|
|
18
|
+
"yaml.schemas": {
|
|
19
|
+
"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json": "/syntaxes/*.yaml"
|
|
20
|
+
}
|
|
16
21
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 2.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a88eea8`](https://github.com/apollographql/vscode-graphql/commit/a88eea86b4a38af6b2edc8d82361b301e051e424) Thanks [@phryneas](https://github.com/phryneas)! - Adjust publish command and trigger re-publish
|
|
8
|
+
|
|
9
|
+
## 2.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#230](https://github.com/apollographql/vscode-graphql/pull/230) [`8626acc`](https://github.com/apollographql/vscode-graphql/commit/8626accc9cdca451a3ecc23a3351d6f138337275) Thanks [@phryneas](https://github.com/phryneas)! - Add syntax highlighting for the Apollo Connectors Mapping language
|
|
14
|
+
|
|
3
15
|
## 2.5.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "vscode-apollo",
|
|
3
3
|
"displayName": "Apollo GraphQL",
|
|
4
4
|
"description": "Rich editor support for GraphQL client and server development that seamlessly integrates with the Apollo platform",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.6.1",
|
|
6
6
|
"referenceID": "87197759-7617-40d0-b32e-46d378e907c7",
|
|
7
7
|
"author": "Apollo GraphQL <opensource@apollographql.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -16,20 +16,26 @@
|
|
|
16
16
|
"types": "lib/index.d.ts",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "node ./src/build.js",
|
|
19
|
-
"build:full": "npm run typecheck && rimraf lib
|
|
19
|
+
"build:full": "npm run typecheck && rimraf lib && npm run build:textmate && npm run build --",
|
|
20
20
|
"build:production": "npm run build:full -- --production",
|
|
21
|
+
"build:textmate": "node ./syntaxes/build.ts",
|
|
21
22
|
"watch": "rimraf lib; npm-run-all -p watch:*",
|
|
22
23
|
"watch:esbuild": "npm run build -- --watch",
|
|
23
24
|
"watch:tsc": "npm run typecheck -- --watch",
|
|
25
|
+
"watch:textmate-yaml": "npm run build:textmate -- --debug --watch",
|
|
24
26
|
"sampleWorkspace:run": "node src/__e2e__/mockServer.js",
|
|
25
27
|
"changeset-version": "changeset version && npm i",
|
|
26
|
-
"changeset-publish": "npm run build
|
|
28
|
+
"changeset-publish": "npm run build:production && changeset publish",
|
|
27
29
|
"typecheck": "tsc --noEmit",
|
|
28
30
|
"lint": "eslint src --ext .ts",
|
|
29
31
|
"format": "prettier --write .",
|
|
30
32
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
31
33
|
"test:extension": "node src/__e2e__/runTests.js",
|
|
32
|
-
"test:textmate": "
|
|
34
|
+
"test:textmate": "npm run test:textmate-ts && npm run test:textmate-connectors-mapping && npm run test:textmate-graphql-connectors-mapping",
|
|
35
|
+
"test:textmate-ts": "npx vscode-tmgrammar-snap -s source.ts -g src/language-server/__tests__/fixtures/TypeScript.tmLanguage.json src/language-server/__tests__/fixtures/documents/*.ts",
|
|
36
|
+
"test:textmate-connectors-mapping": "npm run build:textmate -- --snapshot connectors.mapping.yaml; npx vscode-tmgrammar-test src/__tests__/fixtures/textmate/*.connectors.mapping",
|
|
37
|
+
"test:textmate-graphql-connectors-mapping": "npm run build:textmate -- --snapshot connectors.mapping.yaml; npx vscode-tmgrammar-test src/__tests__/fixtures/textmate/*.graphql",
|
|
38
|
+
"update-connectors-community": "git subtree pull --prefix sampleWorkspace/connectors-community https://github.com/apollographql/connectors-community.git main --squash",
|
|
33
39
|
"codegen": "graphql-codegen",
|
|
34
40
|
"vscode:prepublish": "npm run build:production"
|
|
35
41
|
},
|
|
@@ -93,6 +99,7 @@
|
|
|
93
99
|
"jest-environment-node": "29.7.0",
|
|
94
100
|
"memfs": "4.15.0",
|
|
95
101
|
"npm-run-all": "4.1.5",
|
|
102
|
+
"oniguruma-parser": "^0.12.1",
|
|
96
103
|
"prettier": "3.4.2",
|
|
97
104
|
"rimraf": "6.0.1",
|
|
98
105
|
"ts-jest": "29.2.5",
|
|
@@ -172,6 +179,16 @@
|
|
|
172
179
|
],
|
|
173
180
|
"configuration": "./graphql.configuration.json"
|
|
174
181
|
},
|
|
182
|
+
{
|
|
183
|
+
"id": "apollo.connectors.mapping",
|
|
184
|
+
"aliases": [
|
|
185
|
+
"[Apollo Connectors Mapping Syntax]"
|
|
186
|
+
],
|
|
187
|
+
"filenames": [
|
|
188
|
+
"test.apollo.connectors.mapping"
|
|
189
|
+
],
|
|
190
|
+
"configuration": "./apollo.connectors.mapping.configuration.json"
|
|
191
|
+
},
|
|
175
192
|
{
|
|
176
193
|
"id": "jsonc",
|
|
177
194
|
"filenames": [
|
|
@@ -185,6 +202,23 @@
|
|
|
185
202
|
"scopeName": "source.graphql",
|
|
186
203
|
"path": "./syntaxes/graphql.json"
|
|
187
204
|
},
|
|
205
|
+
{
|
|
206
|
+
"language": "apollo.connectors.mapping",
|
|
207
|
+
"scopeName": "source.apollo.connectors.mapping",
|
|
208
|
+
"path": "./syntaxes/connectors.mapping.json"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"injectTo": [
|
|
212
|
+
"source.graphql"
|
|
213
|
+
],
|
|
214
|
+
"scopeName": "source.apollo.connectors.graphql",
|
|
215
|
+
"path": "./syntaxes/graphql.connectors.json",
|
|
216
|
+
"embeddedLanguages": {
|
|
217
|
+
"meta.embedded.block.connectors.mapping.graphql": "apollo.connectors.mapping",
|
|
218
|
+
"meta.embedded.line.connectors.mapping.graphql": "apollo.connectors.mapping",
|
|
219
|
+
"meta.embedded.string.connectors.mapping.selectionstring.graphql": "apollo.connectors.mapping"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
188
222
|
{
|
|
189
223
|
"injectTo": [
|
|
190
224
|
"source.js",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Connector Bug Report
|
|
3
|
+
about: Create a report to help us fix a connector issue
|
|
4
|
+
title: "[Connector Name] - Bug Title"
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: michael-watson
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Connector**:
|
|
11
|
+
**Connector Module**: *if any*
|
|
12
|
+
|
|
13
|
+
**Describe the bug**
|
|
14
|
+
A clear and concise description of what the bug is.
|
|
15
|
+
|
|
16
|
+
**To Reproduce**
|
|
17
|
+
Steps to reproduce the behavior:
|
|
18
|
+
1. Start [Connector Name] name
|
|
19
|
+
2. Execute this operation:
|
|
20
|
+
|
|
21
|
+
```graphql
|
|
22
|
+
query {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
3. Results:
|
|
28
|
+
|
|
29
|
+
**Expected behavior**
|
|
30
|
+
A clear and concise description of what you expected to happen.
|
|
31
|
+
|
|
32
|
+
**Screenshots**
|
|
33
|
+
If applicable, add screenshots to help explain your problem.
|
|
34
|
+
|
|
35
|
+
**Additional context or recommended fixes**
|
|
36
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [{
|
|
4
|
+
"label": "rover dev",
|
|
5
|
+
"command": "rover", // Could be any other shell command
|
|
6
|
+
"args": ["dev", "--supergraph-config","supergraph.yaml", "--router-config","router.yaml"],
|
|
7
|
+
"type": "shell",
|
|
8
|
+
"problemMatcher": [],
|
|
9
|
+
}]
|
|
10
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Apollo Connectors Community
|
|
2
|
+
|
|
3
|
+
This repository is for builders to share API connectors to help accelerate the community with rich starting points. The basic workflow functionality below can help a builder get a new project started in seconds with a fantastic developer experience.
|
|
4
|
+
|
|
5
|
+
The template for creating with `connectors-community` includes:
|
|
6
|
+
|
|
7
|
+
- A fully working local instance with everything you need to connect to any REST API, just add your APOLLO_KEY and GRAPH_REF and you are ready to go
|
|
8
|
+
- If you want to start with an existing/prebuilt connector in this repo, you can start with that schema and supergraph
|
|
9
|
+
- If you want to create a new connector, the steps to set up your local environment with Rover CLI can be found in our [Getting Started documentation](https://www.apollographql.com/docs/quickstart)
|
|
10
|
+
- A graph in GraphOS created with API keys synced to your local project
|
|
11
|
+
- a dockerfile for [easy deployment](https://www.apollographql.com/docs/graphos/connectors/deployment#router-deployment)
|
|
12
|
+
- VS Code supercharged `.vscode` folder
|
|
13
|
+
- `dev` command with hot reloading for all the related files available as a Task
|
|
14
|
+
- Custom terminal profile created that includes GraphOS API keys
|
|
15
|
+
- Recommendations for the Apollo extension
|
|
16
|
+
|
|
17
|
+
Everything's configured—it all just works. 💪
|
|
18
|
+
|
|
19
|
+
## Set up your environment
|
|
20
|
+
|
|
21
|
+
1. If you have not installed Rover before, install [Rover CLI](https://www.apollographql.com/docs/quickstart):
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
curl -sSL https://rover.apollo.dev/nix/latest | sh
|
|
25
|
+
```
|
|
26
|
+
2. Run `rover init`
|
|
27
|
+
3. Select the option 'Create a new graph'
|
|
28
|
+
4. Select the option 'Start with one or more REST API's
|
|
29
|
+
5. Name your graph
|
|
30
|
+
|
|
31
|
+
Next Rover will generate a GRAPH_REF and APOLLO_KEY for you and provide a command to run from the terminal.
|
|
32
|
+
|
|
33
|
+
It is a best practice to take these values and add them to your terminal environment. For VSCode, that looks like this:
|
|
34
|
+
|
|
35
|
+
In VScode > settings.js add the configuration below then restart VSCode.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
{
|
|
39
|
+
|
|
40
|
+
"terminal.integrated.profiles.osx": {
|
|
41
|
+
|
|
42
|
+
"graphos": {
|
|
43
|
+
|
|
44
|
+
"path": "zsh",
|
|
45
|
+
|
|
46
|
+
"args": ["-l"],
|
|
47
|
+
|
|
48
|
+
"env": {
|
|
49
|
+
|
|
50
|
+
"APOLLO_KEY": "<YOUR_KEY>",
|
|
51
|
+
|
|
52
|
+
"APOLLO_GRAPH_REF": "<GRAPH_REF>"
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
"terminal.integrated.defaultProfile.osx": "graphos"
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Graph development is supported in other IDE's. All directions here are for VSCode. For more details or working in other environments see [IDE Support Documentation.](https://www.apollographql.com/docs/ide-support)
|
|
66
|
+
|
|
67
|
+
## Adding and Running a Prebuilt Connector
|
|
68
|
+
|
|
69
|
+
1. From the connectors folder, choose the prebuilt Connector you want to work with and add all graphql files plus the supergraph.yaml to your new project.
|
|
70
|
+
2. Next open your terminal and run the following:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
rover dev --supergraph-config supergraph.yaml
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Tip for VSCode users
|
|
77
|
+
|
|
78
|
+
1. Install the [VSCode extension](https://www.apollographql.com/docs/ide-support/vs-code) to provide a better development expereince when working with Connectors including syntax highlighting and realt-time feedback.
|
|
79
|
+
This extension requires a configuration file in the root named `apollo.config.json` with the following inside:
|
|
80
|
+
```
|
|
81
|
+
{
|
|
82
|
+
"rover": {}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
2. You can also configure the `rover dev` task for VS Code in the `.vscode/tasks.json` folder:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"version": "2.0.0",
|
|
91
|
+
"tasks": [{
|
|
92
|
+
"label": "rover dev",
|
|
93
|
+
"command": "rover", // Could be any other shell command
|
|
94
|
+
"args": ["dev", "--supergraph-config","supergraph.yaml", "--router-config","./connectors/stripe/router.yaml"],
|
|
95
|
+
"type": "shell",
|
|
96
|
+
"problemMatcher": [],
|
|
97
|
+
}]
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
## Contributing a connector to the community
|
|
101
|
+
|
|
102
|
+
We welcome any and all contributions! There are only a couple requirements:
|
|
103
|
+
|
|
104
|
+
1. *We need to be able to recreate your connector work*. Ideally we can hit some live endpoints. That isn't always possible with some APIs, but if we have an OpenAPI specification with example definitions, we can have a mocked REST API that a connector is built with.
|
|
105
|
+
2. *The connector must be working and complete*. You don't have to implement the entire API to contribute, just a portion of it. We just want to ensure that whatever you have implemented is used in the schema; the goal is to try and avoid unused definitions that should be pruned.
|
|
106
|
+
|
|
107
|
+
That's it! Feel free to open an issue with the ["New Connector" template](./connectors/.template) or a PR with your work. The Apollo DevRel team will help usher your contribution through the process and promote your work to the broader community. If you need some help, you can open a post on the [Apollo Community Forum](https://community.apollographql.com/c/connectors/29) and add the `connectors` tag to it.
|
|
108
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# {TEMPLATE} REST Connector
|
|
2
|
+
|
|
3
|
+
This connector currently covers the {XXX object/functionality} in the {TEMPLATE} API.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
To use the connector, you need {API key or other prereq}.
|
|
8
|
+
|
|
9
|
+
## Additional Setup for VS Code Task runner
|
|
10
|
+
|
|
11
|
+
Edit your `.vscode/settings.json` to include the following keys:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
{
|
|
15
|
+
"terminal.integrated.profiles.osx": {
|
|
16
|
+
"graphos": {
|
|
17
|
+
"path": "zsh",
|
|
18
|
+
"args": ["-l"],
|
|
19
|
+
"env": {
|
|
20
|
+
"API_KEY": "",
|
|
21
|
+
"APOLLO_KEY": "",
|
|
22
|
+
...
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"terminal.integrated.defaultProfile.osx": "graphos"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Once you've set this up, you can execute the `Tasks: Run Task` command in VS Code to run the `rover dev` task.
|
|
31
|
+
Alternatively, you can open a new terminal window in VS Code with the `graphos` profile, then run `rover dev --supergraph-config supergraph.yaml --router-config router.yaml`.
|
|
32
|
+
|
|
33
|
+
## Contributing
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
The following schema modules can be added to this connector:
|
|
37
|
+
|
|
38
|
+
- Example 1
|
|
39
|
+
- Example 2
|
|
40
|
+
|
|
41
|
+
To contribute them, make sure to:
|
|
42
|
+
|
|
43
|
+
1. Add a schema designed for the module as a new `.graphql` file.
|
|
44
|
+
2. Update the `router.yaml` and `supergraph.yaml` files accordingly.
|
|
45
|
+
|
|
46
|
+
See [REST API reference]() for other modules that can be implemented. You can use the current modules in this folder as examples to work with.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
extend schema
|
|
2
|
+
@link(url: "https://specs.apollo.dev/federation/v2.10", import: ["@key", "@requires"])
|
|
3
|
+
@link(
|
|
4
|
+
url: "https://specs.apollo.dev/connect/v0.2"
|
|
5
|
+
import: ["@source", "@connect"]
|
|
6
|
+
)
|
|
7
|
+
@source(
|
|
8
|
+
name: "jsonPlaceholder"
|
|
9
|
+
http: {
|
|
10
|
+
baseURL: "https://jsonplaceholder.typicode.com/"
|
|
11
|
+
}
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
type Post {
|
|
15
|
+
id: ID!
|
|
16
|
+
body: String
|
|
17
|
+
title: String
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type Query {
|
|
21
|
+
posts: [Post]
|
|
22
|
+
@connect(
|
|
23
|
+
source: "jsonPlaceholder"
|
|
24
|
+
http: { GET: "/posts" }
|
|
25
|
+
selection: """
|
|
26
|
+
id
|
|
27
|
+
title
|
|
28
|
+
body
|
|
29
|
+
"""
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
supergraph:
|
|
2
|
+
listen: 0.0.0.0:${env.PORT:-4000}
|
|
3
|
+
|
|
4
|
+
headers:
|
|
5
|
+
all:
|
|
6
|
+
request:
|
|
7
|
+
- propagate:
|
|
8
|
+
matching: .*
|
|
9
|
+
telemetry:
|
|
10
|
+
instrumentation:
|
|
11
|
+
spans:
|
|
12
|
+
mode: spec_compliant
|
|
13
|
+
|
|
14
|
+
# connectors:
|
|
15
|
+
# sources:
|
|
16
|
+
# connectorName.sourceName:
|
|
17
|
+
# $config:
|
|
18
|
+
# apiKey: ${env.API_KEY}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# JSONPlaceholder REST Connector
|
|
2
|
+
|
|
3
|
+
This connector brings [{JSON} Placeholder](https://jsonplaceholder.typicode.com/), which provides fake data for testing and prototyping to GraphQL!
|
|
4
|
+
|
|
5
|
+
The GET operation has been implemented for
|
|
6
|
+
|
|
7
|
+
- Users
|
|
8
|
+
- ToDos
|
|
9
|
+
- Posts
|
|
10
|
+
- Comments
|
|
11
|
+
- Albums
|
|
12
|
+
- Photos
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
extend schema
|
|
2
|
+
@link(
|
|
3
|
+
url: "https://specs.apollo.dev/federation/v2.10"
|
|
4
|
+
import: ["@key"]
|
|
5
|
+
)
|
|
6
|
+
@link(
|
|
7
|
+
url: "https://specs.apollo.dev/connect/v0.2"
|
|
8
|
+
import: ["@connect", "@source"]
|
|
9
|
+
)
|
|
10
|
+
# A @source directive defines a shared data source for multiple connectors.
|
|
11
|
+
@source(
|
|
12
|
+
name: "JSONPlaceholder"
|
|
13
|
+
http: { baseURL: "https://jsonplaceholder.typicode.com/" }
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
type Album @key(fields: "id") {
|
|
17
|
+
id: ID!
|
|
18
|
+
userId: ID!
|
|
19
|
+
title: String
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type User @key(fields: "id") {
|
|
23
|
+
id: ID!
|
|
24
|
+
albums: [Album]
|
|
25
|
+
@connect(
|
|
26
|
+
source: "JSONPlaceholder"
|
|
27
|
+
http: { GET: "/users/{$this.id}/albums" }
|
|
28
|
+
selection: """
|
|
29
|
+
id
|
|
30
|
+
userId
|
|
31
|
+
title
|
|
32
|
+
"""
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type Query {
|
|
37
|
+
getAlbum(id: ID!): Album
|
|
38
|
+
@connect(
|
|
39
|
+
source: "JSONPlaceholder"
|
|
40
|
+
http: { GET: "/albums/{$args.id}" }
|
|
41
|
+
selection: """
|
|
42
|
+
id
|
|
43
|
+
userId
|
|
44
|
+
title
|
|
45
|
+
"""
|
|
46
|
+
entity: true
|
|
47
|
+
)
|
|
48
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
extend schema
|
|
2
|
+
@link(
|
|
3
|
+
url: "https://specs.apollo.dev/federation/v2.10"
|
|
4
|
+
import: ["@key"]
|
|
5
|
+
)
|
|
6
|
+
@link(
|
|
7
|
+
url: "https://specs.apollo.dev/connect/v0.2"
|
|
8
|
+
import: ["@connect", "@source"]
|
|
9
|
+
)
|
|
10
|
+
# A @source directive defines a shared data source for multiple connectors.
|
|
11
|
+
@source(
|
|
12
|
+
name: "JSONPlaceholder"
|
|
13
|
+
http: { baseURL: "https://jsonplaceholder.typicode.com/" }
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
type Comment {
|
|
17
|
+
id: ID!
|
|
18
|
+
postId: ID!
|
|
19
|
+
name: String
|
|
20
|
+
email: String
|
|
21
|
+
body: String
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type Post @key(fields: "id") {
|
|
25
|
+
id: ID!
|
|
26
|
+
comments: [Comment]
|
|
27
|
+
@connect(
|
|
28
|
+
source: "JSONPlaceholder"
|
|
29
|
+
http: { GET: "/posts/{$this.id}/comments" }
|
|
30
|
+
selection: """
|
|
31
|
+
id
|
|
32
|
+
postId
|
|
33
|
+
name
|
|
34
|
+
email
|
|
35
|
+
body
|
|
36
|
+
"""
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type Query {
|
|
41
|
+
getComment(id: ID!): Comment
|
|
42
|
+
@connect(
|
|
43
|
+
source: "JSONPlaceholder"
|
|
44
|
+
http: { GET: "/comments/{$args.id}" }
|
|
45
|
+
selection: """
|
|
46
|
+
id
|
|
47
|
+
postId
|
|
48
|
+
name
|
|
49
|
+
email
|
|
50
|
+
body
|
|
51
|
+
"""
|
|
52
|
+
entity: true
|
|
53
|
+
)
|
|
54
|
+
}
|