fix relay introspection when remote relationships are defined, fix #5144 (#5145)

Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
This commit is contained in:
Rakesh Emmadi 2020-06-24 19:25:50 +05:30 committed by GitHub
parent 01e7b2aea0
commit c7ffd882d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 1 deletions

View File

@ -215,7 +215,9 @@ mkTableObjectFields isRelay =
SFPGColumn info -> pure $ mkPGColFld info
SFRelationship info -> mkRelationshipField isRelay info
SFComputedField info -> pure $ mkComputedFieldFld info
SFRemoteRelationship info -> pure $ mkRemoteRelationshipFld info
SFRemoteRelationship info ->
-- https://github.com/hasura/graphql-engine/issues/5144
if isRelay then [] else pure $ mkRemoteRelationshipFld info
{-
type table {

View File

@ -0,0 +1,27 @@
# https://github.com/hasura/graphql-engine/issues/5144
description: Test remote relationships via relay endpoint
url: /v1/relay
status: 200
query:
query: |
query {
profiles_connection{
edges{
node{
id
name
messageBasic {
id
msg
name
}
}
}
}
}
response:
errors:
- extensions:
path: $.selectionSet.profiles_connection.selectionSet.edges.selectionSet.node.selectionSet.messageBasic
code: validation-failed
message: "field \"messageBasic\" not found in type: 'profiles'"

View File

@ -292,3 +292,15 @@ class TestExecutionWithPermissions:
st_code, resp = hge_ctx.v1q_f(self.dir() + 'setup_multiple_remote_rel.yaml')
assert st_code == 200, resp
check_query_f(hge_ctx, self.dir() + 'complex_multiple_joins.yaml')
@use_test_fixtures
class TestWithRelay:
@classmethod
def dir(cls):
return "queries/remote_schemas/remote_relationships/"
def test_with_relay_fail(self, hge_ctx):
st_code, resp = hge_ctx.v1q_f(self.dir() + 'setup_remote_rel_basic.yaml')
assert st_code == 200, resp
check_query_f(hge_ctx, self.dir() + "with_relay.yaml")