-
Notifications
You must be signed in to change notification settings - Fork 491
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
Allow schema
to be omitted when using default root op names
#364
Allow schema
to be omitted when using default root op names
#364
Conversation
graphql_test.go
Outdated
@@ -2512,15 +2742,19 @@ func (r *inputResolver) Nullable(args struct{ Value *int32 }) *int32 { | |||
return args.Value | |||
} | |||
|
|||
func (r *inputResolver) List(args struct{ Value []*struct{ V int32 } }) []int32 { | |||
func (r *inputResolver) List(args struct { |
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.
Crept in, will revert these unrelated changes
@@ -362,7 +362,8 @@ func (b *execBuilder) makeFieldExec(typeName string, f *schema.Field, m reflect. | |||
var out reflect.Type | |||
if methodIndex != -1 { | |||
out = m.Type.Out(0) | |||
if typeName == "Subscription" && out.Kind() == reflect.Chan { | |||
sub, ok := b.schema.EntryPoints["subscription"] |
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.
This is an existing bug which prevents the subscription
root op having a type named anything other than Subscription
. Had to fix it here to verify correct behaviour for custom type names, but can split that work if desired
10ae3b8
to
6c0f0e3
Compare
Looking through open PRs on the repo, I notice that this has been raised previously under #126 back in 2017, but never merged. The codebase has drifted quite a lot since then, so it has picked up a few conflicts |
} | ||
return nil | ||
} | ||
if t.Kind() != "OBJECT" { |
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.
if _, ok := t.(*schema.Object); !ok {
^ could be a better way of checking this?
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.
They are equivalent, IMHO
Fixes #304