Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function deleteItem() {
try {
const restOperation = del({
apiName: 'myRestApi',
path: 'items/1'
path: 'items/1',
});
await restOperation.response;
console.log('DELETE call succeeded');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ import { get } from 'aws-amplify/api';
async function getItem() {
try {
const restOperation = get({
apiName: 'myRestApi',
path: 'items'
apiName: 'myRestApi',
path: 'items'
options: {
retryStrategy: {
strategy: 'no-retry' // Overrides default jittered exponential backoff retry strategy
},
}
});
const response = await restOperation.response;
console.log('GET call succeeded: ', response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function postItem() {
body: {
message: 'Mow the lawn'
}
}
},
});

const { body } = await restOperation.response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,24 @@ import outputs from '../amplify_outputs.json';

const amplifyConfig = parseAmplifyConfig(outputs);

Amplify.configure({
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
Amplify.configure(
{
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
},
},
});
{
API: {
REST: {
retryStrategy: {
strategy: 'no-retry' // Overrides default jittered exponential backoff retry strategy
},
}
},
}
);
```
</InlineFilter>

Expand All @@ -251,13 +262,24 @@ import outputs from '@/amplify_outputs.json';

const amplifyConfig = parseAmplifyConfig(outputs);

Amplify.configure({
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
Amplify.configure(
{
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
},
},
});
{
API: {
REST: {
retryStrategy: {
strategy: 'no-retry' // Overrides default jittered exponential backoff retry strategy
},
}
}
}
);
```
</InlineFilter>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,24 @@ import outputs from '../amplify_outputs.json';

const amplifyConfig = parseAmplifyConfig(outputs);

Amplify.configure({
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
Amplify.configure(
{
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
},
},
});
{
API: {
REST: {
retryStrategy: {
strategy: 'no-retry', // Overrides default jittered exponential backoff retry strategy
},
}
}
}
);
```
</InlineFilter>

Expand All @@ -234,13 +245,24 @@ import outputs from '@/amplify_outputs.json';

const amplifyConfig = parseAmplifyConfig(outputs);

Amplify.configure({
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
},
});
Amplify.configure(
{
...amplifyConfig,
API: {
...amplifyConfig.API,
REST: outputs.custom.API,
},
},
{
API: {
REST: {
retryStrategy: {
strategy: 'no-retry' // Overrides default jittered exponential backoff retry strategy
},
}
}
}
);
```
</InlineFilter>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function updateItems() {
path: 'items/1',
options: {
body: Item
}
},
});
const response = await restOperation.response;
console.log('PUT call succeeded: ', response);
Expand Down