99designs / 99designs/gqlgen

CollectFields() not merging Fragment with custom addition

Open
#1,329 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

### What happened?
```graphql
fragment House on House {
id,state{foobar}
}

query getHouses {
houses{...House,state{barfoo}}
}
```

When using `CollectFields(ctx)` you get only the fields collected from `fragment House`.

### What did you expect?
A merge of given fragment and additional fields.

### Minimal graphql.schema and models to reproduce
```graphql
type Query {
houses: [House!]
}

type House {
id: ID
state: HouseState
}

type HouseState {
foobar: String
barfoo: String
}
```

### versions
- `gqlgen version`? `v0.12.2-dev`
- `go version`? `go1.15 windows/amd64`
- dep or go modules? `go modules`

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.