-
Notifications
You must be signed in to change notification settings - Fork 42
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
fix: more thorough validation of join arguments #1489
Draft
obmarg
wants to merge
3
commits into
main
Choose a base branch
from
obmarg/push-sqxztlmvkvkq
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
obmarg
force-pushed
the
obmarg/push-sqxztlmvkvkq
branch
from
March 22, 2024 15:21
a2cfca4
to
c9de144
Compare
obmarg
force-pushed
the
obmarg/push-sqxztlmvkvkq
branch
from
March 22, 2024 15:32
c9de144
to
06906b4
Compare
We need to do this to properly support composite keys in our subgraph join support.
obmarg
commented
Mar 22, 2024
Comment on lines
+477
to
+479
Some( | ||
(MetaType::InputObject(_), MetaType::Object(_)) | ||
| (MetaType::Object(_), MetaType::InputObject(_)), |
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.
Might need to do something similar around enums here to handle TAs case :|
Finistere
approved these changes
Mar 25, 2024
I don't think this can be merged in its current form, so making draft till I get time to fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prior to this change the arguments we pass in to a join were not validated very much. The assumption was that any errors would be caught when someone tried to run the join. But, now that joins are getting more complicated and variables present in them can come from more places, it makes sense to put the effort into improving this a bit.
And, that's what this commit does. We now check that variables exist, check that they have compatible types and also similarly check that any literals in the string approximately make sense. I don't expect that we'll catch every single error with this, but it should catch the dumbest of them. In particular I've been quite lax on validating scalars - I don't want to stop block things that are technically wrong but in reality fine (e.g. passing a String to an ID field or vice versa). It could probably be made a little stricter, but lets get this out there and see how it does.
One thing to note is that i haven't done list coercion here. Mostly because it's complex enough as it is and I don't want to add that extra complexity. If someone really wants it we can revisit.
Fixes GB-6305