-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 template error on generated defaults #146
Conversation
Thanks, you're cleaning up :) This could use a test, maybe just a second arg in https://github.com/vektah/gqlgen/blob/master/example/scalars/schema.graphql#L3? |
example/scalars/generated.go
Outdated
@@ -203,7 +203,7 @@ func (ec *executionContext) _Query_search(ctx context.Context, field graphql.Col | |||
return graphql.Null | |||
} | |||
} else { | |||
var tmp interface{} = map[string]interface{}{"location": "37,144", "isBanned": false} | |||
var tmp interface{} = map[string]interface{}{"isBanned": false, "location": "37,144"} |
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.
Oh-oh! I think the map is making this non deterministic. Probably needs a sort first?
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.
yeah looks like it would need a sort.
Nice work |
* fix template error on generated defaults * go fmt * add test for default fix * . * add key sort for default values
See: #143 (comment)
The generated code doesn't separate default values with a comma. This adds a comma.
before:
after:
fixes #144