@ampless/backend 1.0.0-beta.81 → 1.0.0-beta.83
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/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -340,6 +340,10 @@ function amplessSchemaModels(a, opts = {}) {
|
|
|
340
340
|
slug: a.string().required(),
|
|
341
341
|
title: a.string().required(),
|
|
342
342
|
excerpt: a.string(),
|
|
343
|
+
// Amplify enum fields are always nullable — `a.enum(...).required()`
|
|
344
|
+
// is not a runtime function (it throws at CDK synth). The app layer
|
|
345
|
+
// always populates format/status; the TS `Post` interface treats them
|
|
346
|
+
// as non-optional, but the GraphQL schema cannot enforce required here.
|
|
343
347
|
format: a.enum(["tiptap", "markdown", "html", "static"]),
|
|
344
348
|
body: a.json(),
|
|
345
349
|
status: a.enum(["draft", "published"]),
|
|
@@ -363,6 +367,7 @@ function amplessSchemaModels(a, opts = {}) {
|
|
|
363
367
|
pageId: a.id().required(),
|
|
364
368
|
slug: a.string().required(),
|
|
365
369
|
title: a.string().required(),
|
|
370
|
+
// See the note on Post.format/status — enum fields cannot be required.
|
|
366
371
|
format: a.enum(["tiptap", "markdown", "html", "static"]),
|
|
367
372
|
body: a.json(),
|
|
368
373
|
status: a.enum(["draft", "published"]),
|
|
@@ -375,6 +380,9 @@ function amplessSchemaModels(a, opts = {}) {
|
|
|
375
380
|
src: a.string().required(),
|
|
376
381
|
mimeType: a.string().required(),
|
|
377
382
|
size: a.integer(),
|
|
383
|
+
// Bare string (nullable). Enum fields can't be `.required()`, and
|
|
384
|
+
// making this an enum without required would still be a String→enum
|
|
385
|
+
// GraphQL type change; keep the original loose string for now.
|
|
378
386
|
delivery: a.string(),
|
|
379
387
|
// Free-form per-asset metadata (JSON). Currently used to
|
|
380
388
|
// memoise the S3 ETag for stream-back routes; future use
|
package/package.json
CHANGED