This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from preply/extend-fix
fix external/requires regex mismatch
- Loading branch information
Showing
9 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM python:3.6-alpine3.9 | ||
|
||
WORKDIR project | ||
RUN apk add curl | ||
|
||
COPY ./requirements.txt ./ | ||
RUN pip install -r requirements.txt | ||
|
||
EXPOSE 5000 | ||
CMD [ "python", "./src/app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
graphene==2.1.7 | ||
flask==1.1.1 | ||
flask_graphql==2.0.0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from flask import Flask | ||
|
||
from flask_graphql import GraphQLView | ||
from schema import schema | ||
|
||
app = Flask(__name__) | ||
app.debug = True | ||
|
||
app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True)) | ||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from graphene import ObjectType, Int, Field | ||
from graphene_federation import build_schema, extend, external | ||
|
||
""" | ||
Alphabet order - matters | ||
Y should be just after X in sdl | ||
https://github.com/preply/graphene-federation/issues/26#issuecomment-572127271 | ||
""" | ||
|
||
|
||
@extend(fields='id') | ||
class Article(ObjectType): | ||
id = external(Int(required=True)) | ||
|
||
|
||
class X(ObjectType): | ||
x_article = Field(Article) | ||
|
||
|
||
class Y(ObjectType): | ||
id = Int(required=True) | ||
|
||
|
||
class Query(ObjectType): | ||
x = Field(X) | ||
y = Field(Y) | ||
|
||
|
||
schema = build_schema(query=Query) |