houdini 0.13.2-alpha.1 → 0.13.2-alpha.2
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/build/cmd/generators/typescript/addReferencedInputTypes.js +1 -12
- package/build/cmd/generators/typescript/index.js +1 -1
- package/build/cmd.js +2 -2
- package/cmd/generators/typescript/addReferencedInputTypes.ts +4 -5
- package/cmd/generators/typescript/index.ts +5 -3
- package/cmd/generators/typescript/typescript.test.ts +5 -5
- package/package.json +2 -2
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -86,7 +75,7 @@ function addReferencedInputTypes(config, body, visitedTypes, rootType) {
|
|
|
86
75
|
// walk down the referenced fields and build stuff back up
|
|
87
76
|
addReferencedInputTypes(config, body, visitedTypes, field.type);
|
|
88
77
|
// check if the type is optional so we can label the value as omitable
|
|
89
|
-
members.push(AST.tsPropertySignature(
|
|
78
|
+
members.push(AST.tsPropertySignature(AST.identifier(field.name), AST.tsTypeAnnotation(typeReference_1.tsTypeReference(config, field)), graphql.isNullableType(field.type)));
|
|
90
79
|
}
|
|
91
80
|
}
|
|
92
81
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -224,7 +224,7 @@ function generateOperationTypeDefs(config, body, definition, selections, visited
|
|
|
224
224
|
// merge all of the variables into a single object
|
|
225
225
|
body.push(AST.exportNamedDeclaration(AST.tsTypeAliasDeclaration(AST.identifier(inputTypeName), AST.tsTypeLiteral((definition.variableDefinitions || []).map(function (definition) {
|
|
226
226
|
// add a property describing the variable to the root object
|
|
227
|
-
return AST.tsPropertySignature(AST.identifier(definition.variable.name.value), AST.tsTypeAnnotation(typeReference_1.tsTypeReference(config, definition)));
|
|
227
|
+
return AST.tsPropertySignature(AST.identifier(definition.variable.name.value), AST.tsTypeAnnotation(typeReference_1.tsTypeReference(config, definition)), definition.type.kind !== 'NonNullType');
|
|
228
228
|
})))));
|
|
229
229
|
}
|
|
230
230
|
return [2 /*return*/];
|
package/build/cmd.js
CHANGED
|
@@ -78164,7 +78164,7 @@ function addReferencedInputTypes(config, body, visitedTypes, rootType) {
|
|
|
78164
78164
|
// walk down the referenced fields and build stuff back up
|
|
78165
78165
|
addReferencedInputTypes(config, body, visitedTypes, field.type);
|
|
78166
78166
|
// check if the type is optional so we can label the value as omitable
|
|
78167
|
-
members.push(AST$2.tsPropertySignature(
|
|
78167
|
+
members.push(AST$2.tsPropertySignature(AST$2.identifier(field.name), AST$2.tsTypeAnnotation(tsTypeReference(config, field)), graphql.isNullableType(field.type)));
|
|
78168
78168
|
}
|
|
78169
78169
|
}
|
|
78170
78170
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -78566,7 +78566,7 @@ function generateOperationTypeDefs(config, body, definition, selections, visited
|
|
|
78566
78566
|
// merge all of the variables into a single object
|
|
78567
78567
|
body.push(AST.exportNamedDeclaration(AST.tsTypeAliasDeclaration(AST.identifier(inputTypeName), AST.tsTypeLiteral((definition.variableDefinitions || []).map(function (definition) {
|
|
78568
78568
|
// add a property describing the variable to the root object
|
|
78569
|
-
return AST.tsPropertySignature(AST.identifier(definition.variable.name.value), AST.tsTypeAnnotation(tsTypeReference(config, definition)));
|
|
78569
|
+
return AST.tsPropertySignature(AST.identifier(definition.variable.name.value), AST.tsTypeAnnotation(tsTypeReference(config, definition)), definition.type.kind !== 'NonNullType');
|
|
78570
78570
|
})))));
|
|
78571
78571
|
}
|
|
78572
78572
|
return [2 /*return*/];
|
|
@@ -62,13 +62,12 @@ export function addReferencedInputTypes(
|
|
|
62
62
|
addReferencedInputTypes(config, body, visitedTypes, field.type)
|
|
63
63
|
|
|
64
64
|
// check if the type is optional so we can label the value as omitable
|
|
65
|
+
|
|
65
66
|
members.push(
|
|
66
67
|
AST.tsPropertySignature(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
AST.tsTypeAnnotation(tsTypeReference(config, field))
|
|
68
|
+
AST.identifier(field.name),
|
|
69
|
+
AST.tsTypeAnnotation(tsTypeReference(config, field)),
|
|
70
|
+
graphql.isNullableType(field.type)
|
|
72
71
|
)
|
|
73
72
|
)
|
|
74
73
|
}
|
|
@@ -192,12 +192,14 @@ async function generateOperationTypeDefs(
|
|
|
192
192
|
AST.identifier(inputTypeName),
|
|
193
193
|
AST.tsTypeLiteral(
|
|
194
194
|
(definition.variableDefinitions || []).map(
|
|
195
|
-
(definition: graphql.VariableDefinitionNode) =>
|
|
195
|
+
(definition: graphql.VariableDefinitionNode) => {
|
|
196
196
|
// add a property describing the variable to the root object
|
|
197
|
-
AST.tsPropertySignature(
|
|
197
|
+
return AST.tsPropertySignature(
|
|
198
198
|
AST.identifier(definition.variable.name.value),
|
|
199
|
-
AST.tsTypeAnnotation(tsTypeReference(config, definition))
|
|
199
|
+
AST.tsTypeAnnotation(tsTypeReference(config, definition)),
|
|
200
|
+
definition.type.kind !== 'NonNullType'
|
|
200
201
|
)
|
|
202
|
+
}
|
|
201
203
|
)
|
|
202
204
|
)
|
|
203
205
|
)
|
|
@@ -331,7 +331,7 @@ describe('typescript', function () {
|
|
|
331
331
|
|
|
332
332
|
export type Query$input = {
|
|
333
333
|
id: string,
|
|
334
|
-
enum
|
|
334
|
+
enum?: MyEnum | null | undefined
|
|
335
335
|
};
|
|
336
336
|
`)
|
|
337
337
|
})
|
|
@@ -405,13 +405,13 @@ describe('typescript', function () {
|
|
|
405
405
|
};
|
|
406
406
|
|
|
407
407
|
export type Mutation$input = {
|
|
408
|
-
filter
|
|
408
|
+
filter?: UserFilter | null | undefined,
|
|
409
409
|
filterList: (UserFilter)[],
|
|
410
410
|
id: string,
|
|
411
411
|
firstName: string,
|
|
412
|
-
admin
|
|
413
|
-
age
|
|
414
|
-
weight
|
|
412
|
+
admin?: boolean | null | undefined,
|
|
413
|
+
age?: number | null | undefined,
|
|
414
|
+
weight?: number | null | undefined
|
|
415
415
|
};
|
|
416
416
|
`)
|
|
417
417
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini",
|
|
3
|
-
"version": "0.13.2-alpha.
|
|
3
|
+
"version": "0.13.2-alpha.2",
|
|
4
4
|
"description": "The disappearing graphql client for SvelteKit",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:runtime": "npm run build:runtime:cjs && npm run build:runtime:esm",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"rollup-plugin-preserve-shebangs": "^0.2.0",
|
|
58
58
|
"svelte": "^3.34.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "7464d80179817fda2a0e7e3655b309152883be32"
|
|
61
61
|
}
|