Skip to content
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

bugfix: local variable 'data' colliding with argument name #291

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions example/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions generate/operation.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ func {{.Name}}(
return nil, {{if .Config.Extensions -}}nil,{{end -}} err
}
{{end}}
var data {{.ResponseName}}
resp := &graphql.Response{Data: &data}
var data_ {{.ResponseName}}
resp := &graphql.Response{Data: &data_}

err = client.MakeRequest(
{{if ne .Config.ContextType "-"}}ctx{{else}}nil{{end}},
req,
resp,
)

return &data, {{if .Config.Extensions -}}resp.Extensions,{{end -}} err
return &data_, {{if .Config.Extensions -}}resp.Extensions,{{end -}} err
}
5 changes: 5 additions & 0 deletions generate/testdata/queries/MutationArgCalledData.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mutation MutationWithDataArg($data: String!) {
updateUser(data: $data) {
id
}
}
3 changes: 2 additions & 1 deletion generate/testdata/queries/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ type Query {
}

type Mutation {
createUser(name: String!, email: String): User
createUser(name: String!, email: String): User
updateUser(data: String!): User
}

input getPokemonBoolExp {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading