Skip to content

Fieldname "map" #18

@marcown

Description

@marcown

Hey,

first of all: Thanks for the great work.

I have a mutation like this:

mutation testmutation {
  addFile(input: {
    Ids: ["xyxy", "xyxy2"]
    Maps: {
      Id: "daw"
      map: ....
    } 
  }){
    testSuccess
  }
}

The Field "map" is of type Upload!, but map is also a keyword in go. The generator ends up in the following error:
"mixed named and unnamed parameters" because the generated go func has the form

type ObjectInput map[string]interface{}
        func ObjectInput(map transport.Upload,probability float64,) ObjectInput {
            return map[string]interface{}{
                "map": map,
                "probability": probability,
            }
        }

(this is another mutation, but it should be clear)

The generator should filter for some keywords, i.e. map and change it to something like

type ObjectInput map[string]interface{}
        func ObjectInput(map_ transport.Upload,probability float64,) ObjectInput {
            return map[string]interface{}{
                "map": map_,
                "probability": probability,
            }
        }

Any Ideas how to do it and where? I could also do a PR if I had a starting point

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions