@ampless/backend 1.0.0-beta.82 → 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 +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -340,9 +340,13 @@ function amplessSchemaModels(a, opts = {}) {
|
|
|
340
340
|
slug: a.string().required(),
|
|
341
341
|
title: a.string().required(),
|
|
342
342
|
excerpt: a.string(),
|
|
343
|
-
|
|
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.
|
|
347
|
+
format: a.enum(["tiptap", "markdown", "html", "static"]),
|
|
344
348
|
body: a.json(),
|
|
345
|
-
status: a.enum(["draft", "published"])
|
|
349
|
+
status: a.enum(["draft", "published"]),
|
|
346
350
|
publishedAt: a.datetime(),
|
|
347
351
|
tags: a.string().array(),
|
|
348
352
|
// Free-form per-post metadata (JSON). Reserved well-known keys
|
|
@@ -363,9 +367,10 @@ function amplessSchemaModels(a, opts = {}) {
|
|
|
363
367
|
pageId: a.id().required(),
|
|
364
368
|
slug: a.string().required(),
|
|
365
369
|
title: a.string().required(),
|
|
366
|
-
format
|
|
370
|
+
// See the note on Post.format/status — enum fields cannot be required.
|
|
371
|
+
format: a.enum(["tiptap", "markdown", "html", "static"]),
|
|
367
372
|
body: a.json(),
|
|
368
|
-
status: a.enum(["draft", "published"])
|
|
373
|
+
status: a.enum(["draft", "published"]),
|
|
369
374
|
publishedAt: a.datetime()
|
|
370
375
|
}).identifier(["pageId"]).authorization((allow) => [
|
|
371
376
|
allow.groups(["ampless-admin", "ampless-editor"])
|
|
@@ -375,7 +380,10 @@ function amplessSchemaModels(a, opts = {}) {
|
|
|
375
380
|
src: a.string().required(),
|
|
376
381
|
mimeType: a.string().required(),
|
|
377
382
|
size: a.integer(),
|
|
378
|
-
|
|
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.
|
|
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
|
|
381
389
|
// for image dimensions, EXIF strip status, etc. Kept loose
|
package/package.json
CHANGED