-
Notifications
You must be signed in to change notification settings - Fork 53
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: Handle filter input field argument being nil #787
Conversation
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.
Possible query test gap leaking a probable bug (might hide gql intelisense types in client even if query works)
9d10cbd
to
b9ec3d1
Compare
b9ec3d1
to
244c10a
Compare
Have updated PR description with the new changes with John's help which fixes the bug. |
…eldList according to Johns suggestion. Update the schema tests that also fixes an order field.
244c10a
to
dae09a5
Compare
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.
LGTM 😎
@@ -281,7 +281,7 @@ var defaultBookArgsWithoutFilter = trimFields( | |||
buildOrderArg("book", []argDef{ | |||
{ | |||
fieldName: "author", | |||
typeName: "", | |||
typeName: "authorOrderArg", |
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.
thought: Potentially fixes another bug with Order input type.
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.
LGTM 👍
* Resolves: sourcenetwork#784 * Description: - In `generate.go`.genTypeFilterArgInput where if a [field.Type + "FilterArg"] key didn't exist in the `typeMap` it would return nil and pass that to `InputObjectFieldConfig` as Type. - Modify the way `AppendType` was being used in `genTypeQueryableFieldList`. We do direct manipulation of the TypeMap, such that it won't cause any errors. We do still get the benefits of `AppendType` because of our `ResolveType` function (we want to avoid resolving `FieldThunk` too early), - Another schema type generation bug was fixed by the above change where the `OrderArg` for the relation field name would have the type as empty string `""` instead of `"XOrderArg"`.
Relevant issue(s)
Resolves #784
Similar to #701 (PR), #700 (ISSUE)
Description
generate.go
.genTypeFilterArgInput where if a [field.Type + "FilterArg"] key didn't exist in thetypeMap
it would return nil and pass that toInputObjectFieldConfig
as Type.AppendType
was being used ingenTypeQueryableFieldList
. We do direct manipulation of the TypeMap, such that it won't cause any errors. We do still get the benefits ofAppendType
because of ourResolveType
function (we want to avoid resolvingFieldThunk
too early),OrderArg
for the relation field name would have the type as empty string""
instead of"XOrderArg"
.How has this been tested?
Local & CI
Specify the platform(s) on which this was tested: