diff --git a/.changeset/five-meals-refuse.md b/.changeset/five-meals-refuse.md new file mode 100644 index 000000000000..db3fbf899e91 --- /dev/null +++ b/.changeset/five-meals-refuse.md @@ -0,0 +1,7 @@ +--- +'@data-client/endpoint': patch +'@data-client/graphql': patch +'@data-client/rest': patch +--- + +Remove name in toJSON() for Entities diff --git a/.changeset/four-berries-jog.md b/.changeset/four-berries-jog.md new file mode 100644 index 000000000000..2af398b0b4a3 --- /dev/null +++ b/.changeset/four-berries-jog.md @@ -0,0 +1,7 @@ +--- +'@data-client/endpoint': patch +'@data-client/graphql': patch +'@data-client/rest': patch +--- + +Add toString() to Collection diff --git a/packages/endpoint/src/schemas/Collection.ts b/packages/endpoint/src/schemas/Collection.ts index 6cbefeeeb73e..882e322715b4 100644 --- a/packages/endpoint/src/schemas/Collection.ts +++ b/packages/endpoint/src/schemas/Collection.ts @@ -121,11 +121,14 @@ export default class CollectionSchema< return this.schema.schema; } + toString() { + return this.key; + } + toJSON() { return { - name: `Collection(${this.schema.schema.name})`, - schema: this.schema.schema.toJSON(), key: this.key, + schema: this.schema.schema.toJSON(), }; } diff --git a/packages/endpoint/src/schemas/EntitySchema.ts b/packages/endpoint/src/schemas/EntitySchema.ts index c064fe61ddde..d56bf0e8c1f9 100644 --- a/packages/endpoint/src/schemas/EntitySchema.ts +++ b/packages/endpoint/src/schemas/EntitySchema.ts @@ -28,9 +28,8 @@ export default function EntitySchema( static toJSON() { return { - name: this.name, - schema: this.schema, key: this.key, + schema: this.schema, }; }