graphql-buddy 0.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/.github/workflows/ci.yml +32 -0
- package/.nvmrc +1 -0
- package/.prettierignore +1 -0
- package/.prettierrc +7 -0
- package/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/api.d.ts +46 -0
- package/dist/api.js +13 -0
- package/dist/api.js.map +1 -0
- package/dist/chunk-Z7B4AQ2U.js +124 -0
- package/dist/chunk-Z7B4AQ2U.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +122 -0
- package/dist/cli.js.map +1 -0
- package/eslint.config.ts +168 -0
- package/package.json +69 -0
- package/pnpm-workspace.yaml +3 -0
- package/src/api/commands/bundle.test.ts +138 -0
- package/src/api/commands/bundle.ts +29 -0
- package/src/api/commands/index.ts +2 -0
- package/src/api/commands/validate.test.ts +35 -0
- package/src/api/commands/validate.ts +49 -0
- package/src/api/index.ts +2 -0
- package/src/api/shared/index.ts +1 -0
- package/src/api/shared/loadSchema.ts +88 -0
- package/src/cli/commands/bundle.ts +62 -0
- package/src/cli/commands/index.ts +2 -0
- package/src/cli/commands/validate.ts +59 -0
- package/src/cli/index.ts +52 -0
- package/src/cli/shared/index.ts +1 -0
- package/src/cli/shared/parsePathAliases.test.ts +43 -0
- package/src/cli/shared/parsePathAliases.ts +25 -0
- package/test_fixtures/missing_scalar/schema.graphql +16 -0
- package/test_fixtures/multiple_files/Bar.graphql +5 -0
- package/test_fixtures/multiple_files/Baz.graphql +5 -0
- package/test_fixtures/multiple_files/Foo.graphql +9 -0
- package/test_fixtures/multiple_files/Mutation.graphql +9 -0
- package/test_fixtures/multiple_files/Query.graphql +5 -0
- package/test_fixtures/single_file/schema.graphql +16 -0
- package/test_fixtures/single_file_with_extra_deps/schema.graphql +46 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +14 -0
- package/vite.config.ts +14 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type Query {
|
|
2
|
+
foo: Foo
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
type Mutation {
|
|
6
|
+
addFooToBar(displayName: String!): Bar
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type Subscription {
|
|
10
|
+
foo: FooEvent
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Foo {
|
|
14
|
+
id: ID!
|
|
15
|
+
|
|
16
|
+
displayName: String
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type Bar {
|
|
20
|
+
id: ID!
|
|
21
|
+
|
|
22
|
+
foo: Foo
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type FooEvent {
|
|
26
|
+
foo: Foo!
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# Baz is not referenced by the graph starting at Query/Mutation/Subscription
|
|
30
|
+
type Baz {
|
|
31
|
+
id: ID!
|
|
32
|
+
|
|
33
|
+
bar: Bar
|
|
34
|
+
qux: Qux
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# Qux is not referenced by the graph starting at Query/Mutation/Subscription
|
|
38
|
+
type Qux {
|
|
39
|
+
id: ID!
|
|
40
|
+
|
|
41
|
+
dateCreated: DateTime!
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# DateTIme is not referenced by the graph starting at
|
|
45
|
+
# Query/Mutation/Subscription
|
|
46
|
+
scalar DateTime
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": "src",
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"importHelpers": true,
|
|
9
|
+
"lib": ["es2015"],
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"skipDefaultLibCheck": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"strict": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"target": "es2015"
|
|
18
|
+
},
|
|
19
|
+
"include": ["./src/**/*.ts", "./*.ts"]
|
|
20
|
+
}
|
package/tsup.config.ts
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as vite from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default vite.defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
server: {
|
|
6
|
+
deps: {
|
|
7
|
+
// Required for graphql compatability.
|
|
8
|
+
//
|
|
9
|
+
// See https://github.com/vitejs/vite/issues/7879
|
|
10
|
+
fallbackCJS: true,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|