Skip to content

Commit 9594587

Browse files
authored
Fix Example Apps (#218)
* Fix example apps * Update README
1 parent db3e9f4 commit 9594587

File tree

9 files changed

+18
-22
lines changed

9 files changed

+18
-22
lines changed

examples/flask_sqlalchemy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Getting started
99
---------------
1010

1111
First you'll need to get the source of the project. Do this by cloning the
12-
whole Graphene repository:
12+
whole Graphene-SQLAlchemy repository:
1313

1414
```bash
1515
# Get the example project code
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
graphene[sqlalchemy]
2-
SQLAlchemy==1.0.11
3-
Flask==0.12.4
4-
Flask-GraphQL==1.3.0
1+
-e ../../
2+
Flask-GraphQL

examples/nameko_sqlalchemy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Getting started
1414
---------------
1515

1616
First you'll need to get the source of the project. Do this by cloning the
17-
whole Graphene repository:
17+
whole Graphene-SQLAlchemy repository:
1818

1919
```bash
2020
# Get the example project code

examples/nameko_sqlalchemy/app.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from database import db_session, init_db
2+
from schema import schema
3+
14
from graphql_server import (HttpQueryError, default_format_error,
25
encode_execution_results, json_encode,
36
load_json_body, run_http_query)
47

5-
from .database import db_session, init_db
6-
from .schema import schema
7-
88

99
class App():
1010
def __init__(self):

examples/nameko_sqlalchemy/models.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
from database import Base
12
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, func
23
from sqlalchemy.orm import backref, relationship
34

4-
from .database import Base
5-
65

76
class Department(Base):
87
__tablename__ = 'department'
+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
graphene[sqlalchemy]
2-
SQLAlchemy==1.0.11
3-
nameko
1+
-e ../../
42
graphql-server-core
3+
nameko

examples/nameko_sqlalchemy/schema.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
from models import Department as DepartmentModel
2+
from models import Employee as EmployeeModel
3+
from models import Role as RoleModel
4+
15
import graphene
26
from graphene import relay
37
from graphene_sqlalchemy import SQLAlchemyConnectionField, SQLAlchemyObjectType
48

5-
from .models import Department as DepartmentModel
6-
from .models import Employee as EmployeeModel
7-
from .models import Role as RoleModel
8-
99

1010
class Department(SQLAlchemyObjectType):
1111

examples/nameko_sqlalchemy/service.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env python
2+
from app import App
23
from nameko.web.handlers import http
34

4-
from .app import App
5-
65

76
class DepartmentService:
87
name = 'department'

setup.cfg

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ exclude = setup.py,docs/*,examples/*,tests
66
max-line-length = 120
77

88
[isort]
9+
no_lines_before=FIRSTPARTY
910
known_graphene=graphene,graphql_relay,flask_graphql,graphql_server,sphinx_graphene_theme
1011
known_first_party=graphene_sqlalchemy
11-
known_third_party=database,flask,models,nameko,promise,py,pytest,schema,setuptools,singledispatch,six,sqlalchemy,sqlalchemy_utils
12+
known_third_party=app,database,flask,models,nameko,promise,py,pytest,schema,setuptools,singledispatch,six,sqlalchemy,sqlalchemy_utils
1213
sections=FUTURE,STDLIB,THIRDPARTY,GRAPHENE,FIRSTPARTY,LOCALFOLDER
13-
no_lines_before=FIRSTPARTY
14+
skip_glob=examples/nameko_sqlalchemy
1415

1516
[bdist_wheel]
1617
universal=1

0 commit comments

Comments
 (0)