Metadata-Version: 2.4
Name: ariadne-lambda
Version: 0.4.1
Summary: This package extends the Ariadne library by adding a GraphQL HTTP handler designed for use in AWS Lambda environments.
Project-URL: Homepage, https://ariadnegraphql.org/
Project-URL: Repository, https://github.com/mirumee/ariadne-lambda
Project-URL: Bug Tracker, https://github.com/mirumee/ariadne-lambda/issues
Project-URL: Community, https://github.com/mirumee/ariadne/discussions
Author-email: Mirumee Software <ariadne@mirumee.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: ariadne<2.0.0,>=1.0.1
Requires-Dist: aws-lambda-powertools<4.0.0,>=3.0.0
Requires-Dist: pydantic<3.0.0,>=2.4.0
Provides-Extra: dev
Requires-Dist: git-cliff<3.0.0,>=2.0.0; extra == 'dev'
Requires-Dist: ipdb; extra == 'dev'
Requires-Dist: pip>=24.0; extra == 'dev'
Requires-Dist: ruff==0.15.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest-asyncio<2.0.0,>=1.0.0; extra == 'test'
Requires-Dist: pytest-cov<8.0.0,>=7.0.0; extra == 'test'
Requires-Dist: pytest<10.0.0,>=9.0.0; extra == 'test'
Provides-Extra: types
Requires-Dist: ty<0.1.0,>=0.0.20; extra == 'types'
Description-Content-Type: text/markdown

# Ariadne AWS Lambda Extension

This package extends the Ariadne library by adding a GraphQL HTTP handler designed for use in AWS Lambda environments. It enables easy integration of GraphQL services with AWS serverless infrastructure, making it straightforward to deploy GraphQL APIs without worrying about the underlying server management.

## Introduction

This project provides an extension to the Ariadne GraphQL library, specifically tailored for deploying GraphQL APIs on AWS Lambda. It simplifies handling GraphQL requests by providing a custom HTTP handler that seamlessly integrates with the AWS Lambda and API Gateway, allowing developers to focus on their GraphQL schema and resolvers instead of server and infrastructure management.

## Installation

To install the extension, use pip:

```bash
pip install ariadne-lambda
```

## Quick Start

Here's a basic example of how to use the extension in your AWS Lambda function:

```python
from typing import Any

from ariadne import QueryType, gql, make_executable_schema
from ariadne_lambda.graphql import GraphQLLambda
from asgiref.sync import async_to_sync
from aws_lambda_powertools.utilities.typing import LambdaContext

type_defs = gql(
    """
    type Query {
        hello: String!
    }
"""
)
query = QueryType()


@query.field("hello")
def resolve_hello(_, info):
    request = info.context["request"]
    user_agent = request.headers.get("user-agent", "guest")
    return "Hello, %s!" % user_agent


schema = make_executable_schema(type_defs, query)
graphql_app = GraphQLLambda(schema=schema)


def graphql_http_handler(event: dict[str, Any], context: LambdaContext):
    return async_to_sync(graphql_app)(event, context)
```

## Documentation

For full documentation on Ariadne, visit [Ariadne's Documentation](https://ariadnegraphql.org/docs/). For details on AWS Lambda, refer to the [AWS Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html).

## Features

- Easy integration with AWS Lambda and API Gateway.
- Support for GraphQL queries and mutations.
- Customizable context and error handling.
- Seamless extension of the Ariadne library for serverless applications.

## Contributing

We welcome all contributions to Ariadne! If you've found a bug or issue, feel free to use [GitHub issues](https://github.com/mirumee/ariadne-lambda/issues). If you have any questions or feedback, don't hesitate to catch us on [GitHub discussions](https://github.com/mirumee/ariadne/discussions/).

For guidance and instructions, please see [CONTRIBUTING.md](CONTRIBUTING.md).

Also make sure you follow [@AriadneGraphQL](https://twitter.com/AriadneGraphQL) on Twitter for latest updates, news and random musings!

**Crafted with ❤️ by [Mirumee Software](http://mirumee.com)**
<ariadne@mirumee.com>
