gqlgen icon indicating copy to clipboard operation
gqlgen copied to clipboard

CollectFields() not merging Fragment with custom addition

Open razorness opened this issue 3 years ago • 0 comments

What happened?

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

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

razorness avatar Sep 15 '20 10:09 razorness