99designs / 99designs/gqlgen

BLOCKING ISSUE: Error with slice of map[string]interface{} during generation

Abierto
#1,406 6 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
10.8k
Forks
1.3k
Merge medio
2 d 36 min
PR fusionados (30 d)
26

Descripción

### Reproduction repo
https://github.com/frederikhors/gqlgenIssueSliceMapStringInterface.

### Reproduction steps

1. `go run github.com/99designs/gqlgen init`

1. Add these lines to the default `schema.graphqls` file:

```graphql
input NewTodo {
text: String!
userId: String!
rows: [TodoRowInput!]
}

input TodoRowInput {
description: String
}
```

1. add these lines to `gqlgen.yml`:

```yml
TodoRowInput:
model: "map[string]interface{}"
```

1. At the top of `resolver.go` file, between package and import, add the following line:

`//go:generate go run github.com/99designs/gqlgen`

1. Run `go generate ./...`

### The error

```
validation failed: packages.Load: C:\gqlgenIssueSliceMapStringInterface\graph\generated\generated.go:1793:19: cannot use ec.unmarshalOTodoRowInput2mapᚄ(ctx, v) (value of type map[string]interface{}) as []map[string]interface{} value in assignment
exit status 1
graph\resolver.go:1: running "go": exit status 1
```

**Is this a bug?**

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.