houdini-svelte 3.0.0-next.7 → 3.0.0-next.8

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.
@@ -153389,10 +153389,10 @@ var AST32 = recast22.types.builders;
153389
153389
  function unwrappedTsTypeReference(config, filepath, missingScalars, {
153390
153390
  type,
153391
153391
  wrappers
153392
- }, body) {
153392
+ }, body, input) {
153393
153393
  let result;
153394
153394
  if (graphql62.isScalarType(type)) {
153395
- result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
153395
+ result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
153396
153396
  } else if (graphql62.isEnumType(type)) {
153397
153397
  result = enumReference(config, body, type.name);
153398
153398
  } else {
@@ -153409,14 +153409,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
153409
153409
  }
153410
153410
  return result;
153411
153411
  }
153412
- function tsTypeReference(config, filepath, missingScalars, definition, body) {
153412
+ function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
153413
153413
  const { type, wrappers } = unwrapType2(config, definition.type);
153414
153414
  return unwrappedTsTypeReference(
153415
153415
  config,
153416
153416
  filepath,
153417
153417
  missingScalars,
153418
153418
  { type, wrappers },
153419
- body
153419
+ body,
153420
+ input
153420
153421
  );
153421
153422
  }
153422
153423
  function enumReference(config, body, name) {
@@ -153445,7 +153446,7 @@ function nullableField(inner, input = false) {
153445
153446
  }
153446
153447
  return AST32.tsUnionType(members);
153447
153448
  }
153448
- function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
153449
+ function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
153449
153450
  if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
153450
153451
  if (!field) {
153451
153452
  return AST32.tsNeverKeyword();
@@ -153504,6 +153505,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
153504
153505
  return AST32.tsBooleanKeyword();
153505
153506
  }
153506
153507
  case "ID": {
153508
+ if (input) {
153509
+ return AST32.tsUnionType([AST32.tsStringKeyword(), AST32.tsNumberKeyword()]);
153510
+ }
153507
153511
  return AST32.tsStringKeyword();
153508
153512
  }
153509
153513
  default: {
@@ -153514,7 +153518,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
153514
153518
  missingScalars,
153515
153519
  target.ofType,
153516
153520
  body,
153517
- field
153521
+ field,
153522
+ input
153518
153523
  );
153519
153524
  }
153520
153525
  if (config.scalars?.[target.name]) {
@@ -156148,7 +156153,7 @@ ${exportStatement("config")}
156148
156153
  var recast11 = __toESM3(require_main22(), 1);
156149
156154
  var recast7 = __toESM3(require_main22(), 1);
156150
156155
  var AST8 = recast7.types.builders;
156151
- function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
156156
+ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType, input) {
156152
156157
  const { type } = unwrapType2(config, rootType);
156153
156158
  if (graphql19.isScalarType(type)) {
156154
156159
  return;
@@ -156173,12 +156178,20 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
156173
156178
  }
156174
156179
  const members = [];
156175
156180
  for (const field of Object.values(type.getFields())) {
156176
- addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
156181
+ addReferencedInputTypes(
156182
+ config,
156183
+ filepath,
156184
+ body,
156185
+ visitedTypes,
156186
+ missingScalars,
156187
+ field.type,
156188
+ input
156189
+ );
156177
156190
  members.push(
156178
156191
  AST8.tsPropertySignature(
156179
156192
  AST8.identifier(field.name),
156180
156193
  AST8.tsTypeAnnotation(
156181
- tsTypeReference(config, filepath, missingScalars, field, body)
156194
+ tsTypeReference(config, filepath, missingScalars, field, body, input)
156182
156195
  ),
156183
156196
  graphql19.isNullableType(field.type)
156184
156197
  )
@@ -156214,7 +156227,8 @@ function inlineType({
156214
156227
  includeFragments,
156215
156228
  allOptional,
156216
156229
  forceNonNull,
156217
- field
156230
+ field,
156231
+ input
156218
156232
  }) {
156219
156233
  const { type, wrappers } = unwrapType2(config, rootType);
156220
156234
  let result;
@@ -156226,7 +156240,8 @@ function inlineType({
156226
156240
  missingScalars,
156227
156241
  type,
156228
156242
  body,
156229
- field
156243
+ field,
156244
+ input
156230
156245
  );
156231
156246
  } else if (graphql20.isEnumType(type)) {
156232
156247
  ensureImports2({
@@ -156334,7 +156349,8 @@ function inlineType({
156334
156349
  field: {
156335
156350
  field: attributeName,
156336
156351
  parent: type.name
156337
- }
156352
+ },
156353
+ input
156338
156354
  });
156339
156355
  const hasIncludeOrSkipDirective = selection.directives && selection.directives.filter(
156340
156356
  (directive) => directive.name.value === "include" || directive.name.value === "skip"
@@ -156398,7 +156414,8 @@ function inlineType({
156398
156414
  missingScalars,
156399
156415
  includeFragments,
156400
156416
  allOptional,
156401
- field: null
156417
+ field: null,
156418
+ input: false
156402
156419
  });
156403
156420
  let objectType = fragmentType;
156404
156421
  if (fragmentType.type === "TSUnionType") {
@@ -156865,7 +156882,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156865
156882
  body,
156866
156883
  missingScalars,
156867
156884
  includeFragments: true,
156868
- field: null
156885
+ field: null,
156886
+ input: false
156869
156887
  });
156870
156888
  if (artifact.kind === "HoudiniQuery") {
156871
156889
  resultType = withLoadingState({
@@ -156914,7 +156932,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156914
156932
  body,
156915
156933
  visitedTypes,
156916
156934
  missingScalars,
156917
- variableDefinition.type
156935
+ variableDefinition.type,
156936
+ true
156918
156937
  );
156919
156938
  }
156920
156939
  body.push(
@@ -156932,7 +156951,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156932
156951
  filepath,
156933
156952
  missingScalars,
156934
156953
  definition2,
156935
- body
156954
+ body,
156955
+ true
156936
156956
  )
156937
156957
  ),
156938
156958
  definition2.type.kind !== "NonNullType"
@@ -156967,7 +156987,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156967
156987
  missingScalars,
156968
156988
  includeFragments: false,
156969
156989
  allOptional: true,
156970
- field: null
156990
+ field: null,
156991
+ input: false
156971
156992
  })
156972
156993
  )
156973
156994
  )
@@ -157000,7 +157021,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
157000
157021
  filepath,
157001
157022
  missingScalars,
157002
157023
  definition2,
157003
- body
157024
+ body,
157025
+ false
157004
157026
  )
157005
157027
  ),
157006
157028
  definition2.type.kind !== "NonNullType"
@@ -157063,7 +157085,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
157063
157085
  visitedTypes,
157064
157086
  missingScalars,
157065
157087
  includeFragments: true,
157066
- field: null
157088
+ field: null,
157089
+ input: false
157067
157090
  })
157068
157091
  })
157069
157092
  )
@@ -157156,7 +157179,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157156
157179
  {
157157
157180
  field: key,
157158
157181
  parent: type.name
157159
- }
157182
+ },
157183
+ false
157160
157184
  )
157161
157185
  )
157162
157186
  );
@@ -157183,7 +157207,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157183
157207
  {
157184
157208
  field: key,
157185
157209
  parent: type.name
157186
- }
157210
+ },
157211
+ false
157187
157212
  )
157188
157213
  );
157189
157214
  } else if (graphql21.isEnumType(unwrapped.type)) {
@@ -157221,7 +157246,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157221
157246
  body,
157222
157247
  visitedTypes,
157223
157248
  /* @__PURE__ */ new Set(),
157224
- arg.type
157249
+ arg.type,
157250
+ true
157225
157251
  );
157226
157252
  const prop = AST13.tsPropertySignature(
157227
157253
  AST13.identifier(arg.name),
@@ -157231,7 +157257,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157231
157257
  filepath,
157232
157258
  /* @__PURE__ */ new Set(),
157233
157259
  arg,
157234
- body
157260
+ body,
157261
+ graphql21.isInputType(arg.type)
157235
157262
  )
157236
157263
  )
157237
157264
  );
@@ -157343,7 +157370,8 @@ function listDefinitions(config, filepath, body, docs) {
157343
157370
  filepath,
157344
157371
  /* @__PURE__ */ new Set(),
157345
157372
  arg,
157346
- body
157373
+ body,
157374
+ graphql21.isInputType(arg.type)
157347
157375
  )
157348
157376
  )
157349
157377
  );
@@ -153380,10 +153380,10 @@ var AST32 = recast22.types.builders;
153380
153380
  function unwrappedTsTypeReference(config, filepath, missingScalars, {
153381
153381
  type,
153382
153382
  wrappers
153383
- }, body) {
153383
+ }, body, input) {
153384
153384
  let result;
153385
153385
  if (graphql62.isScalarType(type)) {
153386
- result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
153386
+ result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
153387
153387
  } else if (graphql62.isEnumType(type)) {
153388
153388
  result = enumReference(config, body, type.name);
153389
153389
  } else {
@@ -153400,14 +153400,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
153400
153400
  }
153401
153401
  return result;
153402
153402
  }
153403
- function tsTypeReference(config, filepath, missingScalars, definition, body) {
153403
+ function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
153404
153404
  const { type, wrappers } = unwrapType2(config, definition.type);
153405
153405
  return unwrappedTsTypeReference(
153406
153406
  config,
153407
153407
  filepath,
153408
153408
  missingScalars,
153409
153409
  { type, wrappers },
153410
- body
153410
+ body,
153411
+ input
153411
153412
  );
153412
153413
  }
153413
153414
  function enumReference(config, body, name) {
@@ -153436,7 +153437,7 @@ function nullableField(inner, input = false) {
153436
153437
  }
153437
153438
  return AST32.tsUnionType(members);
153438
153439
  }
153439
- function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
153440
+ function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
153440
153441
  if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
153441
153442
  if (!field) {
153442
153443
  return AST32.tsNeverKeyword();
@@ -153495,6 +153496,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
153495
153496
  return AST32.tsBooleanKeyword();
153496
153497
  }
153497
153498
  case "ID": {
153499
+ if (input) {
153500
+ return AST32.tsUnionType([AST32.tsStringKeyword(), AST32.tsNumberKeyword()]);
153501
+ }
153498
153502
  return AST32.tsStringKeyword();
153499
153503
  }
153500
153504
  default: {
@@ -153505,7 +153509,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
153505
153509
  missingScalars,
153506
153510
  target.ofType,
153507
153511
  body,
153508
- field
153512
+ field,
153513
+ input
153509
153514
  );
153510
153515
  }
153511
153516
  if (config.scalars?.[target.name]) {
@@ -156139,7 +156144,7 @@ ${exportStatement("config")}
156139
156144
  var recast11 = __toESM3(require_main22(), 1);
156140
156145
  var recast7 = __toESM3(require_main22(), 1);
156141
156146
  var AST8 = recast7.types.builders;
156142
- function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
156147
+ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType, input) {
156143
156148
  const { type } = unwrapType2(config, rootType);
156144
156149
  if (graphql19.isScalarType(type)) {
156145
156150
  return;
@@ -156164,12 +156169,20 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
156164
156169
  }
156165
156170
  const members = [];
156166
156171
  for (const field of Object.values(type.getFields())) {
156167
- addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
156172
+ addReferencedInputTypes(
156173
+ config,
156174
+ filepath,
156175
+ body,
156176
+ visitedTypes,
156177
+ missingScalars,
156178
+ field.type,
156179
+ input
156180
+ );
156168
156181
  members.push(
156169
156182
  AST8.tsPropertySignature(
156170
156183
  AST8.identifier(field.name),
156171
156184
  AST8.tsTypeAnnotation(
156172
- tsTypeReference(config, filepath, missingScalars, field, body)
156185
+ tsTypeReference(config, filepath, missingScalars, field, body, input)
156173
156186
  ),
156174
156187
  graphql19.isNullableType(field.type)
156175
156188
  )
@@ -156205,7 +156218,8 @@ function inlineType({
156205
156218
  includeFragments,
156206
156219
  allOptional,
156207
156220
  forceNonNull,
156208
- field
156221
+ field,
156222
+ input
156209
156223
  }) {
156210
156224
  const { type, wrappers } = unwrapType2(config, rootType);
156211
156225
  let result;
@@ -156217,7 +156231,8 @@ function inlineType({
156217
156231
  missingScalars,
156218
156232
  type,
156219
156233
  body,
156220
- field
156234
+ field,
156235
+ input
156221
156236
  );
156222
156237
  } else if (graphql20.isEnumType(type)) {
156223
156238
  ensureImports2({
@@ -156325,7 +156340,8 @@ function inlineType({
156325
156340
  field: {
156326
156341
  field: attributeName,
156327
156342
  parent: type.name
156328
- }
156343
+ },
156344
+ input
156329
156345
  });
156330
156346
  const hasIncludeOrSkipDirective = selection.directives && selection.directives.filter(
156331
156347
  (directive) => directive.name.value === "include" || directive.name.value === "skip"
@@ -156389,7 +156405,8 @@ function inlineType({
156389
156405
  missingScalars,
156390
156406
  includeFragments,
156391
156407
  allOptional,
156392
- field: null
156408
+ field: null,
156409
+ input: false
156393
156410
  });
156394
156411
  let objectType = fragmentType;
156395
156412
  if (fragmentType.type === "TSUnionType") {
@@ -156856,7 +156873,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156856
156873
  body,
156857
156874
  missingScalars,
156858
156875
  includeFragments: true,
156859
- field: null
156876
+ field: null,
156877
+ input: false
156860
156878
  });
156861
156879
  if (artifact.kind === "HoudiniQuery") {
156862
156880
  resultType = withLoadingState({
@@ -156905,7 +156923,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156905
156923
  body,
156906
156924
  visitedTypes,
156907
156925
  missingScalars,
156908
- variableDefinition.type
156926
+ variableDefinition.type,
156927
+ true
156909
156928
  );
156910
156929
  }
156911
156930
  body.push(
@@ -156923,7 +156942,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156923
156942
  filepath,
156924
156943
  missingScalars,
156925
156944
  definition2,
156926
- body
156945
+ body,
156946
+ true
156927
156947
  )
156928
156948
  ),
156929
156949
  definition2.type.kind !== "NonNullType"
@@ -156958,7 +156978,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
156958
156978
  missingScalars,
156959
156979
  includeFragments: false,
156960
156980
  allOptional: true,
156961
- field: null
156981
+ field: null,
156982
+ input: false
156962
156983
  })
156963
156984
  )
156964
156985
  )
@@ -156991,7 +157012,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
156991
157012
  filepath,
156992
157013
  missingScalars,
156993
157014
  definition2,
156994
- body
157015
+ body,
157016
+ false
156995
157017
  )
156996
157018
  ),
156997
157019
  definition2.type.kind !== "NonNullType"
@@ -157054,7 +157076,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
157054
157076
  visitedTypes,
157055
157077
  missingScalars,
157056
157078
  includeFragments: true,
157057
- field: null
157079
+ field: null,
157080
+ input: false
157058
157081
  })
157059
157082
  })
157060
157083
  )
@@ -157147,7 +157170,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157147
157170
  {
157148
157171
  field: key,
157149
157172
  parent: type.name
157150
- }
157173
+ },
157174
+ false
157151
157175
  )
157152
157176
  )
157153
157177
  );
@@ -157174,7 +157198,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157174
157198
  {
157175
157199
  field: key,
157176
157200
  parent: type.name
157177
- }
157201
+ },
157202
+ false
157178
157203
  )
157179
157204
  );
157180
157205
  } else if (graphql21.isEnumType(unwrapped.type)) {
@@ -157212,7 +157237,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157212
157237
  body,
157213
157238
  visitedTypes,
157214
157239
  /* @__PURE__ */ new Set(),
157215
- arg.type
157240
+ arg.type,
157241
+ true
157216
157242
  );
157217
157243
  const prop = AST13.tsPropertySignature(
157218
157244
  AST13.identifier(arg.name),
@@ -157222,7 +157248,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
157222
157248
  filepath,
157223
157249
  /* @__PURE__ */ new Set(),
157224
157250
  arg,
157225
- body
157251
+ body,
157252
+ graphql21.isInputType(arg.type)
157226
157253
  )
157227
157254
  )
157228
157255
  );
@@ -157334,7 +157361,8 @@ function listDefinitions(config, filepath, body, docs) {
157334
157361
  filepath,
157335
157362
  /* @__PURE__ */ new Set(),
157336
157363
  arg,
157337
- body
157364
+ body,
157365
+ graphql21.isInputType(arg.type)
157338
157366
  )
157339
157367
  )
157340
157368
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "houdini-svelte",
3
- "version": "3.0.0-next.7",
3
+ "version": "3.0.0-next.8",
4
4
  "description": "The svelte plugin for houdini",
5
5
  "keywords": [
6
6
  "typescript",
@@ -30,7 +30,7 @@
30
30
  "graphql": "^16.10.0",
31
31
  "recast": "^0.23.1",
32
32
  "rollup": "^4.39.0",
33
- "houdini": "^2.0.0-next.4"
33
+ "houdini": "^2.0.0-next.5"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@sveltejs/kit": "^2.9.0",