graphql-go / graphql-go/graphql

Objects with same name

Open
#317 2 comments 7 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

If a have two objects or InputObject with same `Name`, GraphQL return the error: **Unknown type "String"** or something like this.

Ex: Two objects with name `timeType`

```
var timeInputType = graphql.NewInputObject(graphql.InputObjectConfig{
Name: "timeType",
Fields: graphql.InputObjectConfigFieldMap{
"value": &graphql.InputObjectFieldConfig{
Type: graphql.Int,
},
"time": &graphql.InputObjectFieldConfig{
Type: graphql.Int,
},
},
})
```

```
var timeType = graphql.NewObject(graphql.ObjectConfig{
Name: "timeType",
Fields: graphql.Fields{
"value": &graphql.Field{
Type: graphql.Int,
},
"time": &graphql.Field{
Type: graphql.Int,
},
},
})
```

There is a easy way to debug this error?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.