99designs / 99designs/gqlgen

Federation: Entity type is not shareable / Resolver generated for non-resolvable @key

未关闭
#2,387 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
10.8k
派生
1.3k
平均合并
2 天 36 分钟
30 天内合并 PR
26

描述

When defining two subgraphs implementing the same @key directive on the same type:

type SomeEntity @key(fields: "id", resolvable: false) {
id: ID!
}

registering the generated schema in apollographql results in an error message:

UNKNOWN: Non-shareable field "Entity.findSomeEntityByID" is resolved from multiple subgraphs: it is resolved from subgraphs "schema1" and "schema2" and defined as non-shareable in all of them

There are two issues with this:
1. Since resolvable is false, no resolver should be generated
2. If a resolver is generated, it probably should be marked shareable (in https://github.com/99designs/gqlgen/blob/master/plugin/federation/federation.go#L166 )

- `go run github.com/99designs/gqlgen version`?
v0.17.4

- `go version`?
go version go1.19 darwin/arm64

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。