Skip to content

Commit

Permalink
fix edge inline functions (#1349)
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto authored Feb 2, 2023
1 parent 329a82d commit 6b9fc52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.

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

3 changes: 2 additions & 1 deletion internal/graphql/custom_ts.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,8 @@ func getCustomGQLField(processor *codegen.Processor, cd *CustomData, field Custo
switch field.FieldType {
case Accessor, Field:
// for an accessor or field, we only add a resolve function if named differently
if field.GraphQLName != field.FunctionName {
// or if the instance is something like edge.edge
if field.GraphQLName != field.FunctionName || strings.Contains(instance, ".") {
gqlField.HasResolveFunction = true
gqlField.FunctionContents = []string{
fmt.Sprintf("return %s.%s;", instance, field.FunctionName),
Expand Down

0 comments on commit 6b9fc52

Please sign in to comment.