vite-plugin-graphql-loader 3.0.0 → 3.0.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/README.md +30 -8
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -17
- package/dist/index.js.map +1 -1
- package/dist/snippets.d.ts +2 -2
- package/dist/snippets.d.ts.map +1 -1
- package/dist/snippets.js +100 -93
- package/dist/snippets.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A Vite plugin for loading GraphQL .gql and .graphql files, based on [graphql-tag/loader](https://github.com/apollographql/graphql-tag)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This package _doesn't_ generate TypeScript definitions from the queries and fragments - see [vite-plugin-graphql-codegen](https://www.npmjs.com/package/vite-plugin-graphql-codegen) if you require this.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -56,19 +56,41 @@ query ExampleQuery {
|
|
|
56
56
|
import ExampleQuery, { ExampleFragment } from "./example.graphql";
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
If you
|
|
59
|
+
If you have multiple queries in the same file, import them like this:
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
```javascript
|
|
62
|
+
import { FirstQuery, SecondQuery } from "./example.graphql";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## TypeScript
|
|
66
|
+
|
|
67
|
+
If you are using TypeScript, you will have to declare `.gql` or `.graphql` files.
|
|
68
|
+
|
|
69
|
+
Create `graphql.d.ts` anywhere in your source directory and
|
|
62
70
|
|
|
63
71
|
```typescript
|
|
64
72
|
declare module "*.gql";
|
|
65
73
|
declare module "*.graphql";
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**_Alternatively_**, change it to this (replacing .gql with .graphql depending on what you use):
|
|
66
77
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
```typescript
|
|
79
|
+
declare module "*.gql" {
|
|
80
|
+
const Query: import("graphql").DocumentNode;
|
|
81
|
+
export default Query;
|
|
82
|
+
export const _queries: Record<string, import("graphql").DocumentNode>;
|
|
83
|
+
export const _fragments: Record<
|
|
84
|
+
string,
|
|
85
|
+
import("graphql").FragmentDefinitionNode
|
|
86
|
+
>;
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
And then import fragments and queries like so in order to type them as `DocumentNode` and `FragmentDefinitionNode` objects.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import Document, { _queries, _fragments } from "./example.graphql";
|
|
72
94
|
```
|
|
73
95
|
|
|
74
96
|
## Changelog
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,uBAAuB;;;sBAOV,MAAM,MAAM,MAAM;CAqE3C,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { EOL } from "os";
|
|
2
2
|
import { gql } from "graphql-tag";
|
|
3
|
-
import {
|
|
3
|
+
import { ONE_QUERY_FUNCTION_TEMPLATE, UNIQUE_FUNCTION_TEMPLATE, } from "./snippets.js";
|
|
4
4
|
const expandImports = (source) => {
|
|
5
5
|
const lines = source.split(/\r\n|\r|\n/);
|
|
6
|
-
let outputCode
|
|
6
|
+
let outputCode;
|
|
7
7
|
lines.some((line) => {
|
|
8
8
|
const result = line.match(/^#\s?import (.+)$/);
|
|
9
9
|
if (result) {
|
|
10
10
|
const [_, importFile] = result;
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
const importName = "Import_" + importFile.replace(/[^a-z0-9]/gi, "_");
|
|
12
|
+
const importStatement = `import ${importName} from ${importFile};`;
|
|
13
|
+
const appendDefinition = `doc.definitions = doc.definitions.concat(unique(${importName}.definitions));`;
|
|
14
|
+
outputCode =
|
|
15
|
+
(outputCode ?? UNIQUE_FUNCTION_TEMPLATE) +
|
|
16
|
+
importStatement +
|
|
17
|
+
EOL +
|
|
18
|
+
appendDefinition +
|
|
19
|
+
EOL;
|
|
14
20
|
}
|
|
15
21
|
return line.length > 0 && line[0] !== "#";
|
|
16
22
|
});
|
|
17
|
-
return outputCode;
|
|
23
|
+
return outputCode ?? "";
|
|
18
24
|
};
|
|
19
25
|
export const vitePluginGraphqlLoader = () => {
|
|
20
26
|
const graphqlRegex = /\.(?:gql|graphql)$/;
|
|
@@ -33,20 +39,16 @@ const doc = ${JSON.stringify(documentNode)};
|
|
|
33
39
|
doc.loc.source = ${JSON.stringify(documentNode.loc.source)};
|
|
34
40
|
`;
|
|
35
41
|
let outputCode = "";
|
|
36
|
-
const operationCount = documentNode.definitions.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return accum + 1;
|
|
40
|
-
}
|
|
41
|
-
return accum;
|
|
42
|
-
}, 0);
|
|
42
|
+
const operationCount = documentNode.definitions.filter((op) => (op.kind === "OperationDefinition" ||
|
|
43
|
+
op.kind === "FragmentDefinition") &&
|
|
44
|
+
op.name).length;
|
|
43
45
|
if (operationCount < 1) {
|
|
44
46
|
outputCode += `
|
|
45
|
-
|
|
47
|
+
export default doc;
|
|
46
48
|
`;
|
|
47
49
|
}
|
|
48
50
|
else {
|
|
49
|
-
outputCode +=
|
|
51
|
+
outputCode += ONE_QUERY_FUNCTION_TEMPLATE;
|
|
50
52
|
for (const op of documentNode.definitions) {
|
|
51
53
|
if (op.kind === "OperationDefinition" ||
|
|
52
54
|
op.kind === "FragmentDefinition") {
|
|
@@ -60,8 +62,15 @@ doc.loc.source = ${JSON.stringify(documentNode.loc.source)};
|
|
|
60
62
|
}
|
|
61
63
|
const opName = op.name.value;
|
|
62
64
|
outputCode += `
|
|
63
|
-
export const ${opName} = oneQuery(doc, "${opName}")
|
|
64
|
-
|
|
65
|
+
export const ${opName} = oneQuery(doc, "${opName}");`;
|
|
66
|
+
if (op.kind === "OperationDefinition") {
|
|
67
|
+
outputCode += `
|
|
68
|
+
_queries["${opName}"] = ${opName};`;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
outputCode += `
|
|
72
|
+
_fragments["${opName}"] = ${opName};`;
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
75
|
}
|
|
67
76
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACH,2BAA2B,EAC3B,wBAAwB,GAC3B,MAAM,eAAe,CAAC;AAGvB,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,EAAE;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,UAAkB,CAAC;IAEvB,KAAK,CAAC,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC/C,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC;YAE/B,MAAM,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MPLATE: string;
|
|
2
|
+
export declare const ONE_QUERY_FUNCTION_TEMPLATE: string;
|
|
3
3
|
//# sourceMappingURL=snippets.d.ts.map
|
package/dist/snippets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,wBAAwB,QAGpC,CAAC;AAuFF,eAAO,MAAM,2BAA2B,QAYvC,CAAC"}
|
package/dist/snippets.js
CHANGED
|
@@ -1,104 +1,111 @@
|
|
|
1
|
-
export const UNIQUE = `
|
|
2
1
|
const names = {};
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
2
|
+
const unique = (defs) => {
|
|
3
|
+
return defs.filter(function (def) {
|
|
4
|
+
if (def.kind !== "FragmentDefinition")
|
|
5
|
+
return true;
|
|
6
|
+
const name = def.name.value;
|
|
7
|
+
if (names[name]) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
names[name] = true;
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
export const UNIQUE_FUNCTION_TEMPLATE = `
|
|
17
|
+
const names = {};
|
|
18
|
+
const unique = ${unique.toString()};
|
|
17
19
|
`;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (node.kind === "FragmentSpread") {
|
|
22
|
-
refs.add(node.name.value);
|
|
23
|
-
} else if (node.kind === "VariableDefinition") {
|
|
24
|
-
const type = node.type;
|
|
25
|
-
if (type.kind === "NamedType") {
|
|
26
|
-
refs.add(type.name.value);
|
|
20
|
+
const collectFragmentReferences = (node, refs) => {
|
|
21
|
+
if (node.kind === "FragmentSpread") {
|
|
22
|
+
refs.add(node.name.value);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
if (node.variableDefinitions) {
|
|
35
|
-
node.variableDefinitions.forEach(function(def) {
|
|
36
|
-
collectFragmentReferences(def, refs);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (node.definitions) {
|
|
40
|
-
node.definitions.forEach(function(def) {
|
|
41
|
-
collectFragmentReferences(def, refs);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const definitionRefs = {};
|
|
46
|
-
(function extractReferences() {
|
|
47
|
-
doc.definitions.forEach(function(def) {
|
|
48
|
-
if (def.name) {
|
|
49
|
-
const refs = new Set();
|
|
50
|
-
collectFragmentReferences(def, refs);
|
|
51
|
-
definitionRefs[def.name.value] = refs;
|
|
24
|
+
else if (node.kind === "VariableDefinition") {
|
|
25
|
+
const type = node.type;
|
|
26
|
+
if (type.kind === "NamedType") {
|
|
27
|
+
refs.add(type.name.value);
|
|
28
|
+
}
|
|
52
29
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
|
|
30
|
+
if (node.selectionSet) {
|
|
31
|
+
node.selectionSet.selections.forEach(function (selection) {
|
|
32
|
+
collectFragmentReferences(selection, refs);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (node.variableDefinitions) {
|
|
36
|
+
node.variableDefinitions.forEach(function (def) {
|
|
37
|
+
collectFragmentReferences(def, refs);
|
|
38
|
+
});
|
|
60
39
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// Copy the DocumentNode, but clear out the definitions
|
|
65
|
-
const newDoc = {
|
|
66
|
-
kind: doc.kind,
|
|
67
|
-
definitions: [findOperation(doc, operationName)]
|
|
68
|
-
};
|
|
69
|
-
if (doc.hasOwnProperty("loc")) {
|
|
70
|
-
newDoc.loc = doc.loc;
|
|
71
|
-
}
|
|
72
|
-
// Now, for the operation we're running, find any fragments referenced by
|
|
73
|
-
// it or the fragments it references
|
|
74
|
-
const opRefs = definitionRefs[operationName] || new Set();
|
|
75
|
-
const allRefs = new Set();
|
|
76
|
-
let newRefs = new Set();
|
|
77
|
-
// IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one
|
|
78
|
-
opRefs.forEach(function(refName) {
|
|
79
|
-
newRefs.add(refName);
|
|
80
|
-
});
|
|
81
|
-
while (newRefs.size > 0) {
|
|
82
|
-
const prevRefs = newRefs;
|
|
83
|
-
newRefs = new Set();
|
|
84
|
-
prevRefs.forEach(function(refName) {
|
|
85
|
-
if (!allRefs.has(refName)) {
|
|
86
|
-
allRefs.add(refName);
|
|
87
|
-
const childRefs = definitionRefs[refName] || new Set();
|
|
88
|
-
childRefs.forEach(function(childRef) {
|
|
89
|
-
newRefs.add(childRef);
|
|
40
|
+
if (node.definitions) {
|
|
41
|
+
node.definitions.forEach(function (def) {
|
|
42
|
+
collectFragmentReferences(def, refs);
|
|
90
43
|
});
|
|
91
|
-
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const definitionRefs = {};
|
|
47
|
+
const extractReferences = (doc) => {
|
|
48
|
+
doc.definitions.forEach(function (def) {
|
|
49
|
+
if (def.name) {
|
|
50
|
+
const refs = new Set();
|
|
51
|
+
collectFragmentReferences(def, refs);
|
|
52
|
+
definitionRefs[def.name.value] = refs;
|
|
53
|
+
}
|
|
92
54
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
55
|
+
};
|
|
56
|
+
const findOperation = (doc, name) => {
|
|
57
|
+
for (let i = 0; i < doc.definitions.length; i++) {
|
|
58
|
+
const element = doc.definitions[i];
|
|
59
|
+
if (element.name && element.name.value == name) {
|
|
60
|
+
return element;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const oneQuery = (doc, operationName) => {
|
|
65
|
+
const newDoc = {
|
|
66
|
+
kind: doc.kind,
|
|
67
|
+
definitions: [findOperation(doc, operationName)],
|
|
68
|
+
};
|
|
69
|
+
if (doc.hasOwnProperty("loc")) {
|
|
70
|
+
newDoc.loc = doc.loc;
|
|
98
71
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
72
|
+
const opRefs = definitionRefs[operationName] || new Set();
|
|
73
|
+
const allRefs = new Set();
|
|
74
|
+
let newRefs = new Set();
|
|
75
|
+
opRefs.forEach((refName) => {
|
|
76
|
+
newRefs.add(refName);
|
|
77
|
+
});
|
|
78
|
+
while (newRefs.size > 0) {
|
|
79
|
+
const prevRefs = newRefs;
|
|
80
|
+
newRefs = new Set();
|
|
81
|
+
prevRefs.forEach((refName) => {
|
|
82
|
+
if (!allRefs.has(refName)) {
|
|
83
|
+
allRefs.add(refName);
|
|
84
|
+
const childRefs = definitionRefs[refName] || new Set();
|
|
85
|
+
childRefs.forEach((childRef) => {
|
|
86
|
+
newRefs.add(childRef);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
allRefs.forEach((refName) => {
|
|
92
|
+
const op = findOperation(doc, refName);
|
|
93
|
+
if (op) {
|
|
94
|
+
newDoc.definitions.push(op);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return newDoc;
|
|
98
|
+
};
|
|
99
|
+
export const ONE_QUERY_FUNCTION_TEMPLATE = `
|
|
100
|
+
const collectFragmentReferences = ${collectFragmentReferences.toString()};
|
|
101
|
+
const definitionRefs = {};
|
|
102
|
+
const extractReferences = ${extractReferences.toString()};
|
|
103
|
+
extractReferences(doc);
|
|
104
|
+
const findOperation = ${findOperation.toString()};
|
|
105
|
+
const oneQuery = ${oneQuery.toString()};
|
|
106
|
+
|
|
107
|
+
export const _queries = {};
|
|
108
|
+
export const _fragments = {};
|
|
102
109
|
|
|
103
110
|
export default doc;
|
|
104
111
|
`;
|
package/dist/snippets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippets.js","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"snippets.js","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,EAAE,CAAC;AACjB,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE;IACpB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG;QAC5B,IAAI,GAAG,CAAC,IAAI,KAAK,oBAAoB;YAAE,OAAO,IAAI,CAAC;QACnD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACd,OAAO,KAAK,CAAC;QACjB,CAAC;aAAM,CAAC;YACJ,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;YACnB,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;;iBAEvB,MAAM,CAAC,QAAQ,EAAE;CACjC,CAAC;AAGF,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI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