-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: Remove IsObjectArray #2859
feat: Remove IsObjectArray #2859
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2859 +/- ##
===========================================
+ Coverage 79.38% 79.41% +0.03%
===========================================
Files 323 323
Lines 24693 24683 -10
===========================================
- Hits 19602 19601 -1
+ Misses 3687 3680 -7
+ Partials 1404 1402 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 14 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
Looks good! Code is much easier to read now.
ttype, ok = g.manager.schema.TypeMap()[field.Kind.Underlying()] | ||
if !ok { | ||
return nil, NewErrTypeNotFound(field.Kind.Underlying()) | ||
} |
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.
nitpick: minor simplification
if field.Kind.IsObject() {
var ok bool
ttype, ok = g.manager.schema.TypeMap()[field.Kind.Underlying()]
if !ok {
return nil, NewErrTypeNotFound(field.Kind.Underlying())
}
if field.Kind.IsArray() {
ttype = gql.NewList(ttype)
}
}
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.
Good spot, thanks :)
- generate.go simplification
bd29b12
to
9cb75c8
Compare
Relevant issue(s)
Resolves #2356
Description
Removes IsObjectArray.
As well as causing confused code, and an overly-large interface, where their are multiple overlapping ways to check the same thing, this func also dirties the solution for #2493 and #2619.
PR is marked as a feature as it is a public change, could be called 'fix', I think it is a bit vague here give me a shout if you have a strong preference.