Skip to content

chore(docs): correct markdown based on markdown lint #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 15, 2021
Merged
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
932 changes: 465 additions & 467 deletions docs/core/event_handler/api_gateway.md

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions docs/core/event_handler/appsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ This is the sample infrastructure we are using for the initial examples with a A
Value: !GetAtt HelloWorldApi.Arn
```


### Resolver decorator

You can define your functions to match GraphQL types and fields with the `app.resolver()` decorator.
Expand Down Expand Up @@ -238,6 +237,7 @@ Here's an example where we have two separate functions to resolve `getTodo` and
```

=== "getTodo_event.json"

```json
{
"arguments": {
Expand Down Expand Up @@ -288,6 +288,7 @@ Here's an example where we have two separate functions to resolve `getTodo` and
```

=== "listTodos_event.json"

```json
{
"arguments": {},
Expand Down Expand Up @@ -395,6 +396,7 @@ You can nest `app.resolver()` decorator multiple times when resolving fields wit
For Lambda Python3.8+ runtime, this utility supports async functions when you use in conjunction with `asyncio.run`.

=== "async_resolver.py"

```python hl_lines="4 8 10-12 20"
from aws_lambda_powertools import Logger, Tracer

Expand Down Expand Up @@ -602,7 +604,6 @@ Use the following code for `merchantInfo` and `searchMerchant` functions respect

You can subclass `AppSyncResolverEvent` to bring your own set of methods to handle incoming events, by using `data_model` param in the `resolve` method.


=== "custom_model.py"

```python hl_lines="11-14 19 26"
Expand Down Expand Up @@ -662,8 +663,8 @@ You can subclass `AppSyncResolverEvent` to bring your own set of methods to hand

=== "listLocations_event.json"

```json
{
```json
{
"arguments": {},
"identity": null,
"source": null,
Expand Down Expand Up @@ -707,8 +708,8 @@ You can subclass `AppSyncResolverEvent` to bring your own set of methods to hand
"variables": {}
},
"stash": {}
}
```
}
```

## Testing your code

Expand All @@ -719,6 +720,7 @@ You can use either `app.resolve(event, context)` or simply `app(event, context)`
Here's an example from our internal functional test.

=== "test_direct_resolver.py"

```python
def test_direct_resolver():
# Check whether we can handle an example appsync direct resolver
Expand All @@ -739,6 +741,7 @@ Here's an example from our internal functional test.
```

=== "appSyncDirectResolver.json"

```json
--8<-- "tests/events/appSyncDirectResolver.json"
```
Loading