Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fifty-parks-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/data-schema': minor
---

Optimize custom selection set behavior
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ bin
lib
docs
tsconfig.tsbuildinfo
**/*.js
**/*.js
packages/bench
2 changes: 1 addition & 1 deletion packages/benches/combine/combine-CRUDL.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ bench('combined SQL and DDB schema w client types', async () => {
title: 'updated',
});
const _deletedBlog = await client.models.Blog.delete({ id: 'abc' });
}).types([2295900, 'instantiations']);
}).types([2322525, 'instantiations']);
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ bench('p50 conversation operations', async () => {
allow.publicApiKey().to(['read']),
allow.owner(),
]),
ChatBot: a.conversation(input)
.authorization((allow) => allow.owner()),
GossipBot: a.conversation(input)
.authorization((allow) => allow.owner()),
ChatBot: a.conversation(input).authorization((allow) => allow.owner()),
GossipBot: a.conversation(input).authorization((allow) => allow.owner()),
})
.authorization((allow) => allow.publicApiKey());

Expand Down Expand Up @@ -101,4 +99,4 @@ bench('p50 conversation operations', async () => {
});

await conversation?.listMessages();
}).types([13028, 'instantiations']);
}).types([20266, 'instantiations'][(20266, 'instantiations')]);
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,11 @@ bench('prod p50 conversation operations', async () => {
allow.authenticated('identityPool').to(['read']),
allow.owner(),
]),
ChatBot: a.conversation(input)
.authorization((allow) => allow.owner()),
GossipBot: a.conversation(input)
.authorization((allow) => allow.owner()),
HaikuBot: a.conversation(input)
.authorization((allow) => allow.owner()),
MathBot: a.conversation(input)
.authorization((allow) => allow.owner()),
ScienceBot: a.conversation(input)
.authorization((allow) => allow.owner()),
ChatBot: a.conversation(input).authorization((allow) => allow.owner()),
GossipBot: a.conversation(input).authorization((allow) => allow.owner()),
HaikuBot: a.conversation(input).authorization((allow) => allow.owner()),
MathBot: a.conversation(input).authorization((allow) => allow.owner()),
ScienceBot: a.conversation(input).authorization((allow) => allow.owner()),
// [Global authorization rule]
})
.authorization((allow) => allow.publicApiKey());
Expand Down Expand Up @@ -650,4 +645,4 @@ bench('prod p50 conversation operations', async () => {
});

await conversation?.listMessages();
}).types([35375, 'instantiations']);
}).types([44021, 'instantiations'][(44021, 'instantiations')]);
6 changes: 3 additions & 3 deletions packages/benches/p50/ai/p50-conversation-prod.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ bench('prod p50 conversation', () => {
.authorization((allow) => allow.owner()),
// [Global authorization rule]
}).authorization((allow) => allow.publicApiKey());
}).types([20837, 'instantiations']);
}).types([28904,"instantiations"]);

bench('prod p50 conversation w/ client types', () => {
const s = a
Expand Down Expand Up @@ -1217,7 +1217,7 @@ bench('prod p50 conversation w/ client types', () => {
.authorization((allow) => allow.publicApiKey());

type _ = ClientSchema<typeof s>;
}).types([22779, 'instantiations']);
}).types([31252,"instantiations"]);

bench('prod p50 conversation combined w/ client types', () => {
const s1 = a.schema({
Expand Down Expand Up @@ -1820,4 +1820,4 @@ bench('prod p50 conversation combined w/ client types', () => {

const s = a.combine([s1, s2]);
type _ = ClientSchema<typeof s>;
}).types([27012, 'instantiations']);
}).types([35642,"instantiations"]);
6 changes: 3 additions & 3 deletions packages/benches/p50/ai/p50-conversation.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bench('p50 conversation', () => {
GossipBot: a.conversation(input)
.authorization((allow) => allow.owner()),
}).authorization((allow) => allow.publicApiKey());
}).types([8514, 'instantiations']);
}).types([15287,"instantiations"]);

bench('p50 conversation w/ client types', () => {
const s = a
Expand Down Expand Up @@ -120,7 +120,7 @@ bench('p50 conversation w/ client types', () => {
.authorization((allow) => allow.publicApiKey());

type _ = ClientSchema<typeof s>;
}).types([10441, 'instantiations']);
}).types([17622,"instantiations"]);

bench('p50 combined conversation w/ client types', () => {
const s1 = a
Expand Down Expand Up @@ -183,4 +183,4 @@ bench('p50 combined conversation w/ client types', () => {

const s = a.combine([s1, s2]);
type _ = ClientSchema<typeof s>;
}).types([13892, 'instantiations']);
}).types([21309,"instantiations"]);
2 changes: 1 addition & 1 deletion packages/benches/p50/operations/p50-CRUDL.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ bench('p50 CRUDL', async () => {
});

await client.models.Todo.list();
}).types([355529, 'instantiations']);
}).types([365796, 'instantiations']);
2 changes: 1 addition & 1 deletion packages/benches/p50/operations/p50-prod-CRUDL.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,4 +629,4 @@ bench('prod p50 CRUDL', async () => {
});

await client.models.Todo.list();
}).types([692058, 'instantiations']);
}).types([699671, 'instantiations']);
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,4 @@ bench('prod p50 CRUDL', async () => {
});

await client.models.Todo.list({ selectionSet });
}).types([715279, 'instantiations']);
}).types([722895, 'instantiations']);
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ bench('p50 CRUDL', async () => {
});

await client.models.Todo.list({ selectionSet });
}).types([378409, 'instantiations']);
}).types([388679, 'instantiations']);
6 changes: 3 additions & 3 deletions packages/benches/p50/p50-prod.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ bench('prod p50', () => {
]),
// [Global authorization rule]
}).authorization((allow) => allow.publicApiKey());
}).types([20946, 'instantiations']);
}).types([28900, 'instantiations'][(28900, 'instantiations')]);

bench('prod p50 w/ client types', () => {
const s = a
Expand Down Expand Up @@ -1188,7 +1188,7 @@ bench('prod p50 w/ client types', () => {
.authorization((allow) => allow.publicApiKey());

type _ = ClientSchema<typeof s>;
}).types([23327, 'instantiations']);
}).types([31248, 'instantiations'][(31248, 'instantiations')]);

bench('prod p50 combined w/ client types', () => {
const s1 = a.schema({
Expand Down Expand Up @@ -1781,4 +1781,4 @@ bench('prod p50 combined w/ client types', () => {

const s = a.combine([s1, s2]);
type _ = ClientSchema<typeof s>;
}).types([27507, 'instantiations']);
}).types([35583, 'instantiations'][(35583, 'instantiations')]);
6 changes: 3 additions & 3 deletions packages/benches/p50/p50.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bench('p50', () => {
allow.owner(),
]),
}).authorization((allow) => allow.publicApiKey());
}).types([8572, 'instantiations']);
}).types([15283, 'instantiations'][(15283, 'instantiations')]);

bench('p50 w/ client types', () => {
const s = a
Expand Down Expand Up @@ -102,7 +102,7 @@ bench('p50 w/ client types', () => {
.authorization((allow) => allow.publicApiKey());

type _ = ClientSchema<typeof s>;
}).types([10938, 'instantiations']);
}).types([17618, 'instantiations'][(17618, 'instantiations')]);

bench('p50 combined schema w/ client types', () => {
const s1 = a
Expand Down Expand Up @@ -157,4 +157,4 @@ bench('p50 combined schema w/ client types', () => {

const s = a.combine([s1, s2]);
type _ = ClientSchema<typeof s>;
}).types([14350, 'instantiations']);
}).types([21264, 'instantiations'][(21264, 'instantiations')]);
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ bench('complex relationships real world CRUDL', async () => {
// console.log(items[0].id);
// },
// });
}).types([41538, 'instantiations']);
}).types([49464, 'instantiations']);
Loading