-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote relationship create api #2850
remote relationship create api #2850
Conversation
Deploy preview for hasura-docs ready! Built with commit c933b35 |
9676a16
to
e7a23cd
Compare
Review app for commit e7a23cd deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
This seems fine, but it would be wonderful if we could get documentation on all exported functions and data types. Is there anything specifically you think could use more review/attention? |
|
2) Run a GraphQL server per test thread 3) GraphQL proxy which sets a prefix to the types and top-level fields of the schema, and thus can be added a remote.
Review app for commit 1ddd4f2 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
21b9153
to
dc35557
Compare
Review app for commit dc35557 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
dc35557
to
6343d00
Compare
Review app for commit 6343d00 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
6343d00
to
88427cb
Compare
Tests for creation of remote relationships (close #60)
@@ -61,6 +61,7 @@ library | |||
, wai | |||
, postgresql-binary | |||
, process | |||
, validation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
monad-validate might remove some boilerplate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried doing this and TBH it didn't make much of a difference. So just leaving this as is atm.
Review app for commit 6443125 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
@nizar-m Would you mind giving a quick summary of how the new test framework works, and what it can do? Also is there any part in particular that you'd like closer review on? |
1) Use Hasura GraphQL Engine as remote Then it evolved to why not create a proxy to GraphQL server which will add prefixes to the top-level fields of operations (query, mutation, subscription), and to the names of all object, input object and enum types. Then add this proxy as remote itself. That way we do not have to create another remote Hasura GraphQL engine, and so the current test configuration would work. The implementation of the prefixer proxy is in tests-py/gql_prefixer_proxy.py. In tests-py/graphql_server.py this proxy is linked to the path /graphql-prefixer-proxy. So now as remote GraphQL servers, we have those that are implemented in Graphene, plus this proxy. 1.1) Cascade effect 1: Separate remote GraphQL servers for each test thread Fixture remote_gql_server handles the setup of the remote graphql server. Factory fixture remote_get_url provides the full URL when the path to the remote schema is provided. 1.2) Cascade effect 2: Replace localhost:5000 with ${REMOTE_GRAPHQL_ROOT_URL}
|
The last yaml templating part is something that should have a second look. The solution for now works, but it may be confusing for people who are writing tests for the first time. We may move the whole tests into the code, or we may use templating languages like jsonnet or dhall or ytt. If we are using something like jsonnet, ytt or dhall, we need to look at whether they support insert ordering for objects. Looks jsonnet and dhall would not support insert order for jsons for now. ytt on the other hand seems to support it, at least on their playground, but it lacks python bindings. |
- Run pytest using python 3.7
Review app for commit ba8f465 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
def get(self, request): | ||
return Response(HTTPStatus.METHOD_NOT_ALLOWED) | ||
|
||
def _assert_prefixes(self, introspect): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are ensuring that gql proxy is adding prefixes as intended.
@@ -308,7 +313,7 @@ def post(self, req): | |||
if not req.json: | |||
return Response(HTTPStatus.BAD_REQUEST) | |||
res = character_interface_schema.execute(req.json['query']) | |||
respDict = res.to_dict() | |||
respDict = to_dict(res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes exist because we upgraded to Graphene-3.
Some of the tests which we could not run because graphql-core was throwing error can be done now.
Also the errors are much more descriptive with Graphene 3, which includes stuff like the field name and the location of the field in the query.
@@ -11,6 +11,6 @@ query: | |||
args: | |||
name: err-missing-arg | |||
definition: | |||
url: http://localhost:5000/iface-graphql-err-missing-arg | |||
url: ${REMOTE_GRAPHQL_ROOT_URL}/iface-graphql-err-missing-arg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take the root url of remote GraphQL server from the environmental variable ${REMOTE_GRAPHQL_ROOT_URL} instead. This will be set by the remote_gql_server fixture when the remote server is running.
Some deferred websocket tests can be run now
…elvan/graphql-engine into issue-63
Run pytest with python 3.7 (close #63)
Review app for commit 9433aa5 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
let initFieldCalls = NE.init $ rrRemoteFields remoteRel | ||
leafFieldCall = NE.last $ rrRemoteFields remoteRel | ||
(leafParentTypeInfo, leafParentTypeMap) <- | ||
foldl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use foldl' (see: #2933 (comment))
Review app for commit 2d9b323 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
Review app for commit c933b35 deployed to Heroku: https://hge-ci-pull-2850.herokuapp.com |
Review app https://hge-ci-pull-2850.herokuapp.com is deleted |
Description
Independent PR for Remote Joins (excludes execution)
Affected components
Todo