Skip to content

Docs: create Example for usage of AppSync for Mutations #1953

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

Closed
1 task done
tb102122 opened this issue Feb 24, 2023 · 4 comments · Fixed by #1964
Closed
1 task done

Docs: create Example for usage of AppSync for Mutations #1953

tb102122 opened this issue Feb 24, 2023 · 4 comments · Fixed by #1964
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@tb102122
Copy link

What were you searching in the docs?

How to us the use the Framework for Mutations.

Is this related to an existing documentation section?

https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/docs/core/event_handler/appsync.md

How can we improve?

add sample code for todo creation and update.

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.
@tb102122 tb102122 added documentation Improvements or additions to documentation triage Pending triage from maintainers labels Feb 24, 2023
@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Feb 28, 2023
@heitorlessa heitorlessa self-assigned this Feb 28, 2023
@heitorlessa
Copy link
Contributor

Thanks a lot for creating the issue after our discussion on Discord: https://discord.com/channels/1006478942305263677/1006527338621710376/1078461122056814643

Taking your example as the base, I'll create a quick test to be extra sure it works as expected, then send a PR for the docs to get your review (and credit accordingly).


@app.resolver(type_name="Mutation", field_name="createTodo")
@tracer.capture_method
def create_todo(
    id: str = "",  # noqa AA03 VNE003 shadows built-in id to match query argument, e.g., createTodo(id: "some_id")
) -> Todo:
    logger.info(f"Create Todo {id}")
    todos: Response = requests.put(f"https://jsonplaceholder.typicode.com/todos/{id}") // NOT SURE what to DO!
    todos.raise_for_status()

    return todos.json() 

@heitorlessa
Copy link
Contributor

hey @tb102122 just created a draft PR improving the example, and the wording around GraphQL Type and Field in the context of event resolution.

Please let me know your thoughts. I thought it'd be too much to add a mutation json sample given the real estate we're dealing with - let me know otherwise!

#1964

@heitorlessa heitorlessa linked a pull request Feb 28, 2023 that will close this issue
15 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Mar 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

This is now released under 2.9.1 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants