vscode-apollo 1.19.3 → 2.0.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.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +14 -0
- package/.circleci/config.yml +91 -0
- package/.eslintrc.js +10 -0
- package/.git-blame-ignore-revs +2 -0
- package/.gitattributes +1 -0
- package/.github/workflows/release.yml +95 -0
- package/.gitleaks.toml +26 -0
- package/.nvmrc +1 -0
- package/.prettierrc +5 -0
- package/.vscode/launch.json +66 -0
- package/.vscode/settings.json +16 -0
- package/.vscode/tasks.json +60 -0
- package/.vscodeignore +28 -1
- package/CHANGELOG.md +250 -1
- package/CODEOWNERS +4 -0
- package/LICENSE +2 -2
- package/README.md +104 -55
- package/codegen.yml +12 -0
- package/graphql.configuration.json +5 -1
- package/images/IconRun.svg +8 -0
- package/images/marketplace/apollo-wordmark.png +0 -0
- package/jest.config.ts +21 -0
- package/jest.e2e.config.js +17 -0
- package/package.json +102 -23
- package/renovate.json +30 -0
- package/sampleWorkspace/clientSchema/apollo.config.cjs +10 -0
- package/sampleWorkspace/clientSchema/src/clientSchema.js +16 -0
- package/sampleWorkspace/clientSchema/src/test.js +18 -0
- package/sampleWorkspace/fixtures/starwarsSchema.graphql +299 -0
- package/sampleWorkspace/httpSchema/apollo.config.ts +8 -0
- package/sampleWorkspace/httpSchema/src/test.js +9 -0
- package/sampleWorkspace/localSchema/apollo.config.js +8 -0
- package/sampleWorkspace/localSchema/src/test.js +8 -0
- package/sampleWorkspace/localSchemaArray/apollo.config.js +12 -0
- package/sampleWorkspace/localSchemaArray/planets.graphql +20 -0
- package/sampleWorkspace/localSchemaArray/src/test.js +12 -0
- package/sampleWorkspace/sampleWorkspace.code-workspace +20 -0
- package/sampleWorkspace/spotifyGraph/apollo.config.mjs +5 -0
- package/sampleWorkspace/spotifyGraph/src/test.js +11 -0
- package/src/__e2e__/mockServer.js +117 -0
- package/src/__e2e__/mocks.js +13094 -0
- package/src/__e2e__/run.js +23 -0
- package/src/__e2e__/runTests.js +44 -0
- package/src/__e2e__/setup.js +1 -0
- package/src/__e2e__/vscode-environment.js +16 -0
- package/src/__e2e__/vscode.js +1 -0
- package/src/__mocks__/fs.js +3 -0
- package/src/__tests__/statusBar.test.ts +8 -7
- package/src/build.js +57 -0
- package/src/debug.ts +2 -5
- package/src/env/index.ts +1 -0
- package/src/env/typescript-utility-types.ts +2 -0
- package/src/extension.ts +265 -170
- package/src/language-server/__e2e__/clientSchema.e2e.ts +147 -0
- package/src/language-server/__e2e__/httpSchema.e2e.ts +21 -0
- package/src/language-server/__e2e__/localSchema.e2e.ts +25 -0
- package/src/language-server/__e2e__/localSchemaArray.e2e.ts +31 -0
- package/src/language-server/__e2e__/studioGraph.e2e.ts +65 -0
- package/src/language-server/__e2e__/utils.ts +151 -0
- package/src/language-server/__tests__/diagnostics.test.ts +86 -0
- package/src/language-server/__tests__/document.test.ts +187 -0
- package/src/language-server/__tests__/fileSet.test.ts +46 -0
- package/src/language-server/__tests__/fixtures/starwarsSchema.ts +1917 -0
- package/src/language-server/config/__tests__/config.ts +54 -0
- package/src/language-server/config/__tests__/loadConfig.ts +384 -0
- package/src/language-server/config/__tests__/utils.ts +99 -0
- package/src/language-server/config/config.ts +284 -0
- package/src/language-server/config/index.ts +3 -0
- package/src/language-server/config/loadConfig.ts +101 -0
- package/src/language-server/config/utils.ts +45 -0
- package/src/language-server/diagnostics.ts +118 -0
- package/src/language-server/document.ts +277 -0
- package/src/language-server/engine/index.ts +123 -0
- package/src/language-server/engine/operations/frontendUrlRoot.ts +15 -0
- package/src/language-server/engine/operations/schemaTagsAndFieldStats.ts +32 -0
- package/src/language-server/errors/__tests__/NoMissingClientDirectives.test.ts +225 -0
- package/src/language-server/errors/logger.ts +58 -0
- package/src/language-server/errors/validation.ts +274 -0
- package/src/language-server/fileSet.ts +63 -0
- package/src/language-server/format.ts +48 -0
- package/src/language-server/graphqlTypes.ts +16741 -0
- package/src/language-server/index.ts +28 -0
- package/src/language-server/languageProvider.ts +795 -0
- package/src/language-server/loadingHandler.ts +47 -0
- package/src/language-server/project/base.ts +406 -0
- package/src/language-server/project/client.ts +568 -0
- package/src/language-server/project/defaultClientSchema.ts +70 -0
- package/src/language-server/providers/schema/__tests__/file.ts +191 -0
- package/src/language-server/providers/schema/base.ts +15 -0
- package/src/language-server/providers/schema/endpoint.ts +138 -0
- package/src/language-server/providers/schema/engine.ts +204 -0
- package/src/language-server/providers/schema/file.ts +176 -0
- package/src/language-server/providers/schema/index.ts +59 -0
- package/src/language-server/server.ts +274 -0
- package/src/language-server/typings/graphql.d.ts +27 -0
- package/src/language-server/utilities/__tests__/graphql.test.ts +399 -0
- package/src/language-server/utilities/__tests__/uri.ts +55 -0
- package/src/language-server/utilities/debouncer.ts +8 -0
- package/src/language-server/utilities/debug.ts +90 -0
- package/src/language-server/utilities/graphql.ts +433 -0
- package/src/language-server/utilities/index.ts +3 -0
- package/src/language-server/utilities/source.ts +182 -0
- package/src/language-server/utilities/uri.ts +19 -0
- package/src/language-server/workspace.ts +254 -0
- package/src/languageServerClient.ts +22 -15
- package/src/messages.ts +75 -0
- package/src/statusBar.ts +5 -5
- package/src/tools/__tests__/buildServiceDefinition.test.ts +491 -0
- package/src/tools/__tests__/snapshotSerializers/astSerializer.ts +19 -0
- package/src/tools/__tests__/snapshotSerializers/graphQLTypeSerializer.ts +14 -0
- package/src/tools/buildServiceDefinition.ts +241 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/schema/index.ts +2 -0
- package/src/tools/schema/resolveObject.ts +18 -0
- package/src/tools/schema/resolverMap.ts +23 -0
- package/src/tools/utilities/graphql.ts +22 -0
- package/src/tools/utilities/index.ts +3 -0
- package/src/tools/utilities/invariant.ts +5 -0
- package/src/tools/utilities/predicates.ts +5 -0
- package/src/utils.ts +7 -21
- package/syntaxes/graphql.dart.json +2 -4
- package/syntaxes/graphql.ex.json +1 -4
- package/syntaxes/graphql.js.json +3 -3
- package/syntaxes/graphql.json +13 -9
- package/syntaxes/graphql.lua.json +51 -0
- package/syntaxes/graphql.rb.json +1 -1
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +22 -7
- package/create-server-symlink.js +0 -8
- package/lib/debug.d.ts +0 -11
- package/lib/debug.d.ts.map +0 -1
- package/lib/debug.js +0 -48
- package/lib/debug.js.map +0 -1
- package/lib/extension.d.ts +0 -4
- package/lib/extension.d.ts.map +0 -1
- package/lib/extension.js +0 -187
- package/lib/extension.js.map +0 -1
- package/lib/languageServerClient.d.ts +0 -4
- package/lib/languageServerClient.d.ts.map +0 -1
- package/lib/languageServerClient.js +0 -57
- package/lib/languageServerClient.js.map +0 -1
- package/lib/statusBar.d.ts +0 -24
- package/lib/statusBar.d.ts.map +0 -1
- package/lib/statusBar.js +0 -46
- package/lib/statusBar.js.map +0 -1
- package/lib/testRunner/index.d.ts +0 -3
- package/lib/testRunner/index.d.ts.map +0 -1
- package/lib/testRunner/index.js +0 -49
- package/lib/testRunner/index.js.map +0 -1
- package/lib/testRunner/jest-config.d.ts +0 -14
- package/lib/testRunner/jest-config.d.ts.map +0 -1
- package/lib/testRunner/jest-config.js +0 -18
- package/lib/testRunner/jest-config.js.map +0 -1
- package/lib/testRunner/jest-vscode-environment.d.ts +0 -2
- package/lib/testRunner/jest-vscode-environment.d.ts.map +0 -1
- package/lib/testRunner/jest-vscode-environment.js +0 -19
- package/lib/testRunner/jest-vscode-environment.js.map +0 -1
- package/lib/testRunner/jest-vscode-framework-setup.d.ts +0 -1
- package/lib/testRunner/jest-vscode-framework-setup.d.ts.map +0 -1
- package/lib/testRunner/jest-vscode-framework-setup.js +0 -3
- package/lib/testRunner/jest-vscode-framework-setup.js.map +0 -1
- package/lib/testRunner/vscode-test-script.d.ts +0 -2
- package/lib/testRunner/vscode-test-script.d.ts.map +0 -1
- package/lib/testRunner/vscode-test-script.js +0 -23
- package/lib/testRunner/vscode-test-script.js.map +0 -1
- package/lib/utils.d.ts +0 -18
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -52
- package/lib/utils.js.map +0 -1
- package/src/testRunner/README.md +0 -23
- package/src/testRunner/index.ts +0 -72
- package/src/testRunner/jest-config.ts +0 -17
- package/src/testRunner/jest-vscode-environment.ts +0 -25
- package/src/testRunner/jest-vscode-framework-setup.ts +0 -10
- package/src/testRunner/jest.d.ts +0 -37
- package/src/testRunner/vscode-test-script.ts +0 -38
- package/tsconfig.test.json +0 -4
- package/tsconfig.tsbuildinfo +0 -2486
package/package.json
CHANGED
|
@@ -2,36 +2,92 @@
|
|
|
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": "
|
|
5
|
+
"version": "2.0.0",
|
|
6
6
|
"referenceID": "87197759-7617-40d0-b32e-46d378e907c7",
|
|
7
7
|
"author": "Apollo GraphQL <opensource@apollographql.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/apollographql/
|
|
11
|
+
"url": "https://github.com/apollographql/vscode-graphql"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/apollographql/
|
|
14
|
-
"bugs": "https://github.com/apollographql/
|
|
13
|
+
"homepage": "https://github.com/apollographql/vscode-graphql",
|
|
14
|
+
"bugs": "https://github.com/apollographql/vscode-graphql/issues",
|
|
15
15
|
"main": "./lib/extension",
|
|
16
16
|
"types": "lib/index.d.ts",
|
|
17
17
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
18
|
+
"build": "node ./src/build.js",
|
|
19
|
+
"build:full": "npm run typecheck && rimraf lib && npm run build --",
|
|
20
|
+
"build:production": "npm run build:full -- --production",
|
|
21
|
+
"watch": "rimraf lib; npm-run-all -p watch:*",
|
|
22
|
+
"watch:esbuild": "npm run build -- --watch",
|
|
23
|
+
"watch:tsc": "npm run typecheck -- --watch",
|
|
24
|
+
"sampleWorkspace:run": "node src/__e2e__/mockServer.js",
|
|
25
|
+
"changeset-version": "changeset version && npm i",
|
|
26
|
+
"changeset-publish": "npm run build -- --production && changeset publish",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"lint": "eslint src --ext .ts",
|
|
29
|
+
"format": "prettier --write .",
|
|
30
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
31
|
+
"test:extension": "node src/__e2e__/runTests.js",
|
|
32
|
+
"codegen": "graphql-codegen",
|
|
33
|
+
"vscode:prepublish": "npm run build:production"
|
|
27
34
|
},
|
|
28
35
|
"engines": {
|
|
29
|
-
"vscode": "^1.
|
|
36
|
+
"vscode": "^1.90.0"
|
|
30
37
|
},
|
|
31
38
|
"dependencies": {
|
|
32
|
-
"apollo
|
|
33
|
-
"apollo
|
|
34
|
-
"
|
|
39
|
+
"@apollo/client": "3.11.4",
|
|
40
|
+
"@apollo/subgraph": "2.8.4",
|
|
41
|
+
"@graphql-tools/schema": "10.0.4",
|
|
42
|
+
"@wry/context": "0.7.4",
|
|
43
|
+
"@wry/equality": "0.5.7",
|
|
44
|
+
"cosmiconfig": "9.0.0",
|
|
45
|
+
"dotenv": "16.4.5",
|
|
46
|
+
"glob": "11.0.0",
|
|
47
|
+
"graphql": "16.9.0",
|
|
48
|
+
"graphql-language-service": "5.2.2",
|
|
49
|
+
"graphql-tag": "2.12.6",
|
|
50
|
+
"lodash.debounce": "4.0.8",
|
|
51
|
+
"lodash.merge": "4.6.2",
|
|
52
|
+
"lz-string": "1.5.0",
|
|
53
|
+
"minimatch": "10.0.1",
|
|
54
|
+
"moment": "2.30.1",
|
|
55
|
+
"vscode-languageclient": "9.0.1",
|
|
56
|
+
"vscode-languageserver": "9.0.1",
|
|
57
|
+
"vscode-languageserver-textdocument": "1.0.12",
|
|
58
|
+
"vscode-uri": "3.0.8",
|
|
59
|
+
"zod": "3.23.8",
|
|
60
|
+
"zod-validation-error": "3.3.1"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@changesets/changelog-github": "0.4.8",
|
|
64
|
+
"@changesets/cli": "2.26.2",
|
|
65
|
+
"@graphql-codegen/cli": "^5.0.2",
|
|
66
|
+
"@graphql-codegen/typescript-operations": "^4.2.3",
|
|
67
|
+
"@types/jest": "29.5.12",
|
|
68
|
+
"@types/lodash.debounce": "4.0.9",
|
|
69
|
+
"@types/lodash.merge": "4.6.9",
|
|
70
|
+
"@types/node": "20.14.10",
|
|
71
|
+
"@types/vscode": "1.90.0",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "6.9.1",
|
|
73
|
+
"@typescript-eslint/parser": "6.9.1",
|
|
74
|
+
"@vscode/test-cli": "^0.0.10",
|
|
75
|
+
"@vscode/test-electron": "^2.4.1",
|
|
76
|
+
"@wry/trie": "^0.5.0",
|
|
77
|
+
"esbuild": "^0.23.0",
|
|
78
|
+
"eslint": "8.52.0",
|
|
79
|
+
"eslint-config-prettier": "9.0.0",
|
|
80
|
+
"eslint-plugin-prettier": "5.0.1",
|
|
81
|
+
"graphql-http": "^1.22.1",
|
|
82
|
+
"jest": "29.7.0",
|
|
83
|
+
"jest-environment-node": "29.7.0",
|
|
84
|
+
"memfs": "4.11.1",
|
|
85
|
+
"npm-run-all": "^4.1.5",
|
|
86
|
+
"prettier": "3.0.3",
|
|
87
|
+
"rimraf": "6.0.1",
|
|
88
|
+
"ts-jest": "29.1.2",
|
|
89
|
+
"ts-node": "^10.9.2",
|
|
90
|
+
"typescript": "^5.5.3"
|
|
35
91
|
},
|
|
36
92
|
"publisher": "apollographql",
|
|
37
93
|
"categories": [
|
|
@@ -40,12 +96,13 @@
|
|
|
40
96
|
],
|
|
41
97
|
"icon": "images/icon-apollo-blue-400x400.png",
|
|
42
98
|
"activationEvents": [
|
|
43
|
-
"workspaceContains:**/apollo.config.[jt]s"
|
|
99
|
+
"workspaceContains:**/apollo.config.[jt]s",
|
|
100
|
+
"workspaceContains:**/apollo.config.[cm]js"
|
|
44
101
|
],
|
|
45
102
|
"contributes": {
|
|
46
103
|
"configuration": {
|
|
47
104
|
"type": "object",
|
|
48
|
-
"title": "
|
|
105
|
+
"title": "Apollo GraphQL",
|
|
49
106
|
"properties": {
|
|
50
107
|
"apollographql.trace.server": {
|
|
51
108
|
"scope": "window",
|
|
@@ -57,6 +114,18 @@
|
|
|
57
114
|
],
|
|
58
115
|
"default": "off",
|
|
59
116
|
"description": "Traces the communication between VS Code and the language server."
|
|
117
|
+
},
|
|
118
|
+
"apollographql.debug.revealOutputOnLanguageServerError": {
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"default": true,
|
|
121
|
+
"markdownDescription": "Switches to the \"Output\" tab whenever an error occurs in the language server.",
|
|
122
|
+
"scope": "window"
|
|
123
|
+
},
|
|
124
|
+
"apollographql.display.showRunInStudioButton": {
|
|
125
|
+
"type": "boolean",
|
|
126
|
+
"default": true,
|
|
127
|
+
"markdownDescription": "Show a \"Run in Studio\" button to the right of Operation Signatures.",
|
|
128
|
+
"scope": "window"
|
|
60
129
|
}
|
|
61
130
|
}
|
|
62
131
|
},
|
|
@@ -84,9 +153,10 @@
|
|
|
84
153
|
"injectTo": [
|
|
85
154
|
"source.js",
|
|
86
155
|
"source.ts",
|
|
87
|
-
"source.
|
|
156
|
+
"source.jsx",
|
|
88
157
|
"source.tsx",
|
|
89
|
-
"source.vue"
|
|
158
|
+
"source.vue",
|
|
159
|
+
"source.svelte"
|
|
90
160
|
],
|
|
91
161
|
"scopeName": "inline.graphql",
|
|
92
162
|
"path": "./syntaxes/graphql.js.json",
|
|
@@ -104,6 +174,16 @@
|
|
|
104
174
|
"meta.embedded.block.graphql": "graphql"
|
|
105
175
|
}
|
|
106
176
|
},
|
|
177
|
+
{
|
|
178
|
+
"injectTo": [
|
|
179
|
+
"source.lua"
|
|
180
|
+
],
|
|
181
|
+
"scopeName": "inline.graphql.lua",
|
|
182
|
+
"path": "./syntaxes/graphql.lua.json",
|
|
183
|
+
"embeddedLanguages": {
|
|
184
|
+
"meta.embedded.block.graphql": "graphql"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
107
187
|
{
|
|
108
188
|
"injectTo": [
|
|
109
189
|
"source.ruby"
|
|
@@ -166,6 +246,5 @@
|
|
|
166
246
|
"galleryBanner": {
|
|
167
247
|
"color": "#1d127d",
|
|
168
248
|
"theme": "dark"
|
|
169
|
-
}
|
|
170
|
-
"gitHead": "7f77a11e5c3123137af9235b4a32ac76ec1aad39"
|
|
249
|
+
}
|
|
171
250
|
}
|
package/renovate.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["apollo-open-source"],
|
|
3
|
+
"dependencyDashboard": true,
|
|
4
|
+
"packageRules": [
|
|
5
|
+
{
|
|
6
|
+
"groupName": "all @types",
|
|
7
|
+
"groupSlug": "all-types",
|
|
8
|
+
"matchPackagePatterns": ["@types/*"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"groupName": "all devDependencies",
|
|
12
|
+
"groupSlug": "all-dev",
|
|
13
|
+
"matchPackagePatterns": ["*"],
|
|
14
|
+
"matchDepTypes": ["devDependencies"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"groupName": "all dependencies - patch updates",
|
|
18
|
+
"groupSlug": "all-patch",
|
|
19
|
+
"matchPackagePatterns": ["*"],
|
|
20
|
+
"matchUpdateTypes": ["patch"]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"ignoreDeps": [
|
|
24
|
+
"@types/node",
|
|
25
|
+
"@types/vscode",
|
|
26
|
+
"@typescript-eslint/eslint-plugin",
|
|
27
|
+
"@typescript-eslint/parser",
|
|
28
|
+
"eslint"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
gql`
|
|
3
|
+
extend type Droid {
|
|
4
|
+
"""
|
|
5
|
+
A client-side addition
|
|
6
|
+
"""
|
|
7
|
+
model: String @deprecated(reason: "It's just a robot...")
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
extend type Query {
|
|
11
|
+
"""
|
|
12
|
+
Whether to use defer
|
|
13
|
+
"""
|
|
14
|
+
featureFlagDefer: Boolean!
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import gql from "graphql-tag";
|
|
2
|
+
gql`
|
|
3
|
+
query Test($defer: Boolean!) {
|
|
4
|
+
featureFlagDefer @client(always: false) @export(as: "defer")
|
|
5
|
+
droid(id: "2000") {
|
|
6
|
+
name
|
|
7
|
+
model @client
|
|
8
|
+
primaryFunction @nonreactive
|
|
9
|
+
... @defer(if: $defer, label: "fc") {
|
|
10
|
+
friendsConnection(after: 0, first: 3) @connection(key: "feed") {
|
|
11
|
+
friends {
|
|
12
|
+
id
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The query type, represents all of the entry points into our object graph
|
|
3
|
+
"""
|
|
4
|
+
type Query {
|
|
5
|
+
hero(episode: Episode): Character
|
|
6
|
+
|
|
7
|
+
reviews(episode: Episode!): [Review]
|
|
8
|
+
|
|
9
|
+
search(text: String): [SearchResult]
|
|
10
|
+
|
|
11
|
+
character(id: ID!): Character
|
|
12
|
+
|
|
13
|
+
droid(id: ID!): Droid
|
|
14
|
+
|
|
15
|
+
human(id: ID!): Human
|
|
16
|
+
|
|
17
|
+
starship(id: ID!): Starship
|
|
18
|
+
}
|
|
19
|
+
"""
|
|
20
|
+
The episodes in the Star Wars trilogy
|
|
21
|
+
"""
|
|
22
|
+
enum Episode {
|
|
23
|
+
"""
|
|
24
|
+
Star Wars Episode IV: A New Hope, released in 1977.
|
|
25
|
+
"""
|
|
26
|
+
NEWHOPE
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
Star Wars Episode V: The Empire Strikes Back, released in 1980.
|
|
30
|
+
"""
|
|
31
|
+
EMPIRE
|
|
32
|
+
|
|
33
|
+
"""
|
|
34
|
+
Star Wars Episode VI: Return of the Jedi, released in 1983.
|
|
35
|
+
"""
|
|
36
|
+
JEDI
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
A character from the Star Wars universe
|
|
41
|
+
"""
|
|
42
|
+
interface Character {
|
|
43
|
+
"""
|
|
44
|
+
The ID of the character
|
|
45
|
+
"""
|
|
46
|
+
id: ID!
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
The name of the character
|
|
50
|
+
"""
|
|
51
|
+
name: String!
|
|
52
|
+
|
|
53
|
+
"""
|
|
54
|
+
The friends of the character, or an empty list if they have none
|
|
55
|
+
"""
|
|
56
|
+
friends: [Character]
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
The friends of the character exposed as a connection with edges
|
|
60
|
+
"""
|
|
61
|
+
friendsConnection(first: Int, after: ID): FriendsConnection!
|
|
62
|
+
|
|
63
|
+
"""
|
|
64
|
+
The movies this character appears in
|
|
65
|
+
"""
|
|
66
|
+
appearsIn: [Episode]!
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
A connection object for a character's friends
|
|
71
|
+
"""
|
|
72
|
+
type FriendsConnection {
|
|
73
|
+
"""
|
|
74
|
+
The total number of friends
|
|
75
|
+
"""
|
|
76
|
+
totalCount: Int
|
|
77
|
+
|
|
78
|
+
"""
|
|
79
|
+
The edges for each of the character's friends.
|
|
80
|
+
"""
|
|
81
|
+
edges: [FriendsEdge]
|
|
82
|
+
|
|
83
|
+
"""
|
|
84
|
+
A list of the friends, as a convenience when edges are not needed.
|
|
85
|
+
"""
|
|
86
|
+
friends: [Character]
|
|
87
|
+
|
|
88
|
+
"""
|
|
89
|
+
Information for paginating this connection
|
|
90
|
+
"""
|
|
91
|
+
pageInfo: PageInfo!
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
"""
|
|
95
|
+
An edge object for a character's friends
|
|
96
|
+
"""
|
|
97
|
+
type FriendsEdge {
|
|
98
|
+
"""
|
|
99
|
+
A cursor used for pagination
|
|
100
|
+
"""
|
|
101
|
+
cursor: ID!
|
|
102
|
+
|
|
103
|
+
"""
|
|
104
|
+
The character represented by this friendship edge
|
|
105
|
+
"""
|
|
106
|
+
node: Character
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
"""
|
|
110
|
+
Information for paginating this connection
|
|
111
|
+
"""
|
|
112
|
+
type PageInfo {
|
|
113
|
+
startCursor: ID
|
|
114
|
+
|
|
115
|
+
endCursor: ID
|
|
116
|
+
|
|
117
|
+
hasNextPage: Boolean!
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
"""
|
|
121
|
+
Represents a review for a movie
|
|
122
|
+
"""
|
|
123
|
+
type Review {
|
|
124
|
+
"""
|
|
125
|
+
The number of stars this review gave, 1-5
|
|
126
|
+
"""
|
|
127
|
+
stars: Int!
|
|
128
|
+
|
|
129
|
+
"""
|
|
130
|
+
Comment about the movie
|
|
131
|
+
"""
|
|
132
|
+
commentary: String
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
"""
|
|
136
|
+
"""
|
|
137
|
+
union SearchResult = Human | Droid | Starship
|
|
138
|
+
|
|
139
|
+
"""
|
|
140
|
+
A humanoid creature from the Star Wars universe
|
|
141
|
+
"""
|
|
142
|
+
type Human implements Character {
|
|
143
|
+
"""
|
|
144
|
+
The ID of the human
|
|
145
|
+
"""
|
|
146
|
+
id: ID!
|
|
147
|
+
|
|
148
|
+
"""
|
|
149
|
+
What this human calls themselves
|
|
150
|
+
"""
|
|
151
|
+
name: String!
|
|
152
|
+
|
|
153
|
+
"""
|
|
154
|
+
The home planet of the human, or null if unknown
|
|
155
|
+
"""
|
|
156
|
+
homePlanet: String
|
|
157
|
+
|
|
158
|
+
"""
|
|
159
|
+
Height in the preferred unit, default is meters
|
|
160
|
+
"""
|
|
161
|
+
height(unit: LengthUnit = METER): Float
|
|
162
|
+
|
|
163
|
+
"""
|
|
164
|
+
Mass in kilograms, or null if unknown
|
|
165
|
+
"""
|
|
166
|
+
mass: Float
|
|
167
|
+
|
|
168
|
+
"""
|
|
169
|
+
This human's friends, or an empty list if they have none
|
|
170
|
+
"""
|
|
171
|
+
friends: [Character]
|
|
172
|
+
|
|
173
|
+
"""
|
|
174
|
+
The friends of the human exposed as a connection with edges
|
|
175
|
+
"""
|
|
176
|
+
friendsConnection(first: Int, after: ID): FriendsConnection!
|
|
177
|
+
|
|
178
|
+
"""
|
|
179
|
+
The movies this human appears in
|
|
180
|
+
"""
|
|
181
|
+
appearsIn: [Episode]!
|
|
182
|
+
|
|
183
|
+
"""
|
|
184
|
+
A list of starships this person has piloted, or an empty list if none
|
|
185
|
+
"""
|
|
186
|
+
starships: [Starship]
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
"""
|
|
190
|
+
Units of height
|
|
191
|
+
"""
|
|
192
|
+
enum LengthUnit {
|
|
193
|
+
"""
|
|
194
|
+
The standard unit around the world
|
|
195
|
+
"""
|
|
196
|
+
METER
|
|
197
|
+
|
|
198
|
+
"""
|
|
199
|
+
Primarily used in the United States
|
|
200
|
+
"""
|
|
201
|
+
FOOT
|
|
202
|
+
|
|
203
|
+
"""
|
|
204
|
+
Ancient unit used during the Middle Ages
|
|
205
|
+
"""
|
|
206
|
+
CUBIT @deprecated(reason: "Test deprecated enum case")
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
type Starship {
|
|
210
|
+
"""
|
|
211
|
+
The ID of the starship
|
|
212
|
+
"""
|
|
213
|
+
id: ID!
|
|
214
|
+
|
|
215
|
+
"""
|
|
216
|
+
The name of the starship
|
|
217
|
+
"""
|
|
218
|
+
name: String!
|
|
219
|
+
|
|
220
|
+
"""
|
|
221
|
+
Length of the starship, along the longest axis
|
|
222
|
+
"""
|
|
223
|
+
length(unit: LengthUnit = METER): Float
|
|
224
|
+
|
|
225
|
+
coordinates: [[Float!]!]
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
"""
|
|
229
|
+
An autonomous mechanical character in the Star Wars universe
|
|
230
|
+
"""
|
|
231
|
+
type Droid implements Character {
|
|
232
|
+
"""
|
|
233
|
+
The ID of the droid
|
|
234
|
+
"""
|
|
235
|
+
id: ID!
|
|
236
|
+
|
|
237
|
+
"""
|
|
238
|
+
What others call this droid
|
|
239
|
+
"""
|
|
240
|
+
name: String!
|
|
241
|
+
|
|
242
|
+
"""
|
|
243
|
+
This droid's friends, or an empty list if they have none
|
|
244
|
+
"""
|
|
245
|
+
friends: [Character]
|
|
246
|
+
|
|
247
|
+
"""
|
|
248
|
+
The friends of the droid exposed as a connection with edges
|
|
249
|
+
"""
|
|
250
|
+
friendsConnection(first: Int, after: ID): FriendsConnection!
|
|
251
|
+
|
|
252
|
+
"""
|
|
253
|
+
The movies this droid appears in
|
|
254
|
+
"""
|
|
255
|
+
appearsIn: [Episode]!
|
|
256
|
+
|
|
257
|
+
"""
|
|
258
|
+
This droid's primary function
|
|
259
|
+
"""
|
|
260
|
+
primaryFunction: String
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
"""
|
|
264
|
+
The mutation type, represents all updates we can make to our data
|
|
265
|
+
"""
|
|
266
|
+
type Mutation {
|
|
267
|
+
createReview(episode: Episode, review: ReviewInput!): Review
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
"""
|
|
271
|
+
The input object sent when someone is creating a new review
|
|
272
|
+
"""
|
|
273
|
+
input ReviewInput {
|
|
274
|
+
"""
|
|
275
|
+
0-5 stars
|
|
276
|
+
"""
|
|
277
|
+
stars: Int!
|
|
278
|
+
|
|
279
|
+
"""
|
|
280
|
+
Comment about the movie, optional
|
|
281
|
+
"""
|
|
282
|
+
commentary: String
|
|
283
|
+
|
|
284
|
+
"""
|
|
285
|
+
Favorite color, optional
|
|
286
|
+
"""
|
|
287
|
+
favorite_color: ColorInput
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
"""
|
|
291
|
+
The input object sent when passing in a color
|
|
292
|
+
"""
|
|
293
|
+
input ColorInput {
|
|
294
|
+
red: Int!
|
|
295
|
+
|
|
296
|
+
green: Int!
|
|
297
|
+
|
|
298
|
+
blue: Int!
|
|
299
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
client: {
|
|
3
|
+
service: {
|
|
4
|
+
name: "localMultiSchema",
|
|
5
|
+
localSchemaFile: [
|
|
6
|
+
"./starwarsSchema.graphql",
|
|
7
|
+
// this documents an unfixed bug: in this multi-folder-workspace, this looks for files relative to the first folder in the .code-workspace file
|
|
8
|
+
"./planets.graphql",
|
|
9
|
+
],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The query type, represents all of the entry points into our object graph
|
|
3
|
+
"""
|
|
4
|
+
type Query {
|
|
5
|
+
planets: [Planet]
|
|
6
|
+
}
|
|
7
|
+
"""
|
|
8
|
+
The planets mentioned in the Star Wars trilogy
|
|
9
|
+
"""
|
|
10
|
+
type Planet {
|
|
11
|
+
"""
|
|
12
|
+
Id of the planet
|
|
13
|
+
"""
|
|
14
|
+
id: ID!
|
|
15
|
+
|
|
16
|
+
"""
|
|
17
|
+
Name of the planet
|
|
18
|
+
"""
|
|
19
|
+
name: String!
|
|
20
|
+
}
|