Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graphql-python/graphene-gae
GraphQL Support for Google AppEngine [DEPRECATED - Looking for maintainers]
https://github.com/graphql-python/graphene-gae
google-appengine graphene graphql python
Last synced: about 1 month ago
JSON representation
GraphQL Support for Google AppEngine [DEPRECATED - Looking for maintainers]
- Host: GitHub
- URL: https://github.com/graphql-python/graphene-gae
- Owner: graphql-python
- License: bsd-3-clause
- Archived: true
- Created: 2016-05-11T20:41:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T11:33:23.000Z (over 2 years ago)
- Last Synced: 2024-08-09T22:52:46.778Z (4 months ago)
- Topics: google-appengine, graphene, graphql, python
- Language: Python
- Homepage: http://docs.graphene-python.org/projects/gae/en/latest/
- Size: 179 KB
- Stars: 117
- Watchers: 14
- Forks: 14
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-graphql - graphene-gae - Adds GraphQL support to Google AppEngine (GAE). (Libraries / Python Libraries)
- awesome-graphql - graphene-gae - Adds GraphQL support to Google AppEngine (GAE). (Libraries / Python Libraries)
README
# Graphene GAE (deprecated!)
> :warning: This repository is deprecated due to lack of maintainers.
If you're interested in taking over let us know via [the Graphene
Slack](https://join.slack.com/t/graphenetools/shared_invite/enQtOTE2MDQ1NTg4MDM1LTA4Nzk0MGU0NGEwNzUxZGNjNDQ4ZjAwNDJjMjY0OGE1ZDgxZTg4YjM2ZTc4MjE2ZTAzZjE2ZThhZTQzZTkyMmM)A Google AppEngine integration library for
[Graphene](http://graphene-python.org)- Free software: BSD license
- Documentation: .## Upgrade Notes
If you're upgrading from an older version (pre 2.0 version) please check
out the [Graphene Upgrade
Guide](https://github.com/graphql-python/graphene/blob/master/UPGRADE-v2.0.md).## Installation
To install Graphene-GAE on your AppEngine project, go to your project
folder and runthis command in your shell:``` bash
pip install graphene-gae -t ./libs
```This will install the library and its dependencies to the libs folder under your projects root - so the
dependencies get uploaded withyour GAE project when you publish your
app.Make sure the libs folder is in your
python path by adding the following to your \`appengine_config.py\`:``` python
import sysfor path in ['libs']:
if path not in sys.path:
sys.path[0:0] = [path]
```## Examples
Here's a simple GAE model:
``` python
class Article(ndb.Model):
headline = ndb.StringProperty()
summary = ndb.TextProperty()
text = ndb.TextProperty()author_key = ndb.KeyProperty(kind='Author')
created_at = ndb.DateTimeProperty(auto_now_add=True)
updated_at = ndb.DateTimeProperty(auto_now=True)
```To create a GraphQL schema for it you simply have to write the
following:``` python
import graphene
from graphene_gae import NdbObjectTypeclass ArticleType(NdbObjectType):
class Meta:
model = Articleclass QueryRoot(graphene.ObjectType):
articles = graphene.List(ArticleType)@graphene.resolve_only_args
def resolve_articles(self):
return Article.query()schema = graphene.Schema(query=QueryRoot)
```Then you can simply query the schema:
``` python
query = '''
query GetArticles {
articles {
headline,
summary,
created_at
}
}
'''
result = schema.execute(query)
```To learn more check out the following [examples](examples/):
- [Starwars](examples/starwars)
## Contributing
After cloning this repo, ensure dependencies are installed by running:
``` sh
make deps
make install
```Make sure tests and lint are running:
``` sh
make test
make lint
```