graphql-api


Namegraphql-api JSON
Version 1.3.22 PyPI version JSON
download
home_pagehttps://gitlab.com/parob/graphql-api
SummaryA framework for building Python GraphQL APIs.
upload_time2025-01-31 01:11:24
maintainerNone
docs_urlNone
authorRobert Parker
requires_pythonNone
licenseMIT
keywords graphql graphql-api graphqlapi server
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GraphQL API
Framework for building a GraphQL API with Python

[![coverage report](https://gitlab.com/parob/graphql-api/badges/master/coverage.svg)](https://gitlab.com/parob/graphql-api/commits/master)

[![pipeline status](https://gitlab.com/parob/graphql-api/badges/master/pipeline.svg)](https://gitlab.com/parob/graphql-api/commits/master)



## Installation

##### Pip
```
pip install graphql-api
```

## Run the Unit Tests
To run the tests.
```
pip install pipenv
pipenv install --dev
pipenv run python -m pytest tests --cov=graphql_api
```

## Docs

The documentation is public, and is generated using Sphinx.

[GraphQL-API Documentation](http://parob.gitlab.io/graphql-api/)

##### Build documentation
To build a local static HTML version of the documentation.
```
pip install pipenv
pipenv install sphinx
pipenv run sphinx-build docs ./public -b html
```

## Simple Example
``` python
from graphql_api import GraphQLAPI

api = GraphQLAPI()

@api.type(is_root_type=True)
class MathService:

    @api.field
    def is_odd(self, number: int) -> str:
        return "No" if (num % 2) else "Yes"


query = '''
    query {
        isOdd(number: 5)
    }
'''

result = api.executor().execute(query)

print(result.data)
```

``` text
$ python example.py
>>> {'isOdd': 'No'}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/parob/graphql-api",
    "name": "graphql-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "GraphQL, GraphQL-API, GraphQLAPI, Server",
    "author": "Robert Parker",
    "author_email": "rob@parob.com",
    "download_url": "https://files.pythonhosted.org/packages/4f/7a/46606941316077c50828b532c9a496842f0604cfc714fd611aece690b176/graphql_api-1.3.22.tar.gz",
    "platform": null,
    "description": "# GraphQL API\nFramework for building a GraphQL API with Python\n\n[![coverage report](https://gitlab.com/parob/graphql-api/badges/master/coverage.svg)](https://gitlab.com/parob/graphql-api/commits/master)\n\n[![pipeline status](https://gitlab.com/parob/graphql-api/badges/master/pipeline.svg)](https://gitlab.com/parob/graphql-api/commits/master)\n\n\n\n## Installation\n\n##### Pip\n```\npip install graphql-api\n```\n\n## Run the Unit Tests\nTo run the tests.\n```\npip install pipenv\npipenv install --dev\npipenv run python -m pytest tests --cov=graphql_api\n```\n\n## Docs\n\nThe documentation is public, and is generated using Sphinx.\n\n[GraphQL-API Documentation](http://parob.gitlab.io/graphql-api/)\n\n##### Build documentation\nTo build a local static HTML version of the documentation.\n```\npip install pipenv\npipenv install sphinx\npipenv run sphinx-build docs ./public -b html\n```\n\n## Simple Example\n``` python\nfrom graphql_api import GraphQLAPI\n\napi = GraphQLAPI()\n\n@api.type(is_root_type=True)\nclass MathService:\n\n    @api.field\n    def is_odd(self, number: int) -> str:\n        return \"No\" if (num % 2) else \"Yes\"\n\n\nquery = '''\n    query {\n        isOdd(number: 5)\n    }\n'''\n\nresult = api.executor().execute(query)\n\nprint(result.data)\n```\n\n``` text\n$ python example.py\n>>> {'isOdd': 'No'}\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A framework for building Python GraphQL APIs.",
    "version": "1.3.22",
    "project_urls": {
        "Download": "https://gitlab.com/parob/graphql/-/archive/v1.3.22/graphql_api-v1.3.22.tar.gz",
        "Homepage": "https://gitlab.com/parob/graphql-api"
    },
    "split_keywords": [
        "graphql",
        " graphql-api",
        " graphqlapi",
        " server"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4f7a46606941316077c50828b532c9a496842f0604cfc714fd611aece690b176",
                "md5": "c19ced283d604414109ade16048b7e37",
                "sha256": "78cdf9ae785f0371d525e36493525663b2930870907f8d2d3f26c45a0f55254d"
            },
            "downloads": -1,
            "filename": "graphql_api-1.3.22.tar.gz",
            "has_sig": false,
            "md5_digest": "c19ced283d604414109ade16048b7e37",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 46228,
            "upload_time": "2025-01-31T01:11:24",
            "upload_time_iso_8601": "2025-01-31T01:11:24.695462Z",
            "url": "https://files.pythonhosted.org/packages/4f/7a/46606941316077c50828b532c9a496842f0604cfc714fd611aece690b176/graphql_api-1.3.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-31 01:11:24",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "parob",
    "gitlab_project": "graphql-api",
    "lcname": "graphql-api"
}
        
Elapsed time: 2.57402s