-
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
Server: Don't throw validation error while creating remote relationship joining singular type with array type #5603
Merged
kodiakhq
merged 11 commits into
hasura:master
from
codingkarthik:remote-relationship-validation-bug-5133
Aug 27, 2020
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bf2de78
server: don't throw validation error when joining singleton type to a…
codingkarthik 87b1b57
reword a comment
codingkarthik 22b4b28
add changelog
codingkarthik 8f2a780
improve the assertType check while validating remote relationship
codingkarthik 32766d2
show the GraphQL type instead of just the base type while throwing error
codingkarthik 0a34d58
refactor assertType to isTypeCoercible
codingkarthik a3704b4
Update CHANGELOG.md
codingkarthik a34913f
update changelog
codingkarthik d4e2955
Merge branch 'master' into remote-relationship-validation-bug-5133
codingkarthik 22d563c
use multiwayif instead of nested if-else
codingkarthik 95b0808
Merge branch 'master' into remote-relationship-validation-bug-5133
codingkarthik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
26 changes: 26 additions & 0 deletions
26
.../remote_schemas/remote_relationships/basic_relationship_joining_singleton_with_array.yaml
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,26 @@ | ||
description: Simple Remote relationship with singleton input value type joining to an expected array input type | ||
url: /v1/graphql | ||
status: 200 | ||
response: | ||
data: | ||
profiles: | ||
- id: 1 | ||
remoteUsers: | ||
- user_id: 1 | ||
userMessages: | ||
- id: 1 | ||
msg: "You win!" | ||
query: | ||
query: | | ||
query { | ||
profiles(where:{ id: { _eq: 1}}) { | ||
id | ||
remoteUsers { | ||
user_id | ||
userMessages { | ||
id | ||
msg | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...es/remote_schemas/remote_relationships/setup_remote_rel_joining_singleton_with_array.yaml
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,25 @@ | ||
type: bulk | ||
args: | ||
- type: create_remote_relationship | ||
args: | ||
name: remoteUsers | ||
table: profiles | ||
hasura_fields: | ||
- id | ||
remote_schema: my-remote-schema | ||
remote_field: | ||
users: | ||
arguments: | ||
user_ids: "$id" | ||
|
||
- type: create_remote_relationship | ||
args: | ||
name: remoteUsersMultipleIds | ||
table: profiles | ||
hasura_fields: | ||
- id | ||
remote_schema: my-remote-schema | ||
remote_field: | ||
users: | ||
arguments: | ||
user_ids: ["$id"] | ||
tirumaraiselvan marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think technically "singleton" type is called
named
type but we can fix this comment later.