@theguild/federation-composition 0.21.1 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,7 +148,10 @@ function KeyRules(context) {
148
148
  if (usedOnInterface) {
149
149
  const expectedFieldsValue = normalizedFieldsArgValue.value;
150
150
  knownObjectsAndInterfaces.forEach((def) => {
151
- if (def.interfaces?.some((i) => i.name.value === typeDef.name.value)) {
151
+ const defIsObjectType = def.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION ||
152
+ def.kind === graphql_1.Kind.OBJECT_TYPE_EXTENSION;
153
+ if (defIsObjectType &&
154
+ def.interfaces?.some((i) => i.name.value === typeDef.name.value)) {
152
155
  let shouldError = true;
153
156
  const keyDirectives = def.directives?.filter((d) => context.isAvailableFederationDirective("key", d));
154
157
  if (!!keyDirectives?.length) {
@@ -145,7 +145,10 @@ export function KeyRules(context) {
145
145
  if (usedOnInterface) {
146
146
  const expectedFieldsValue = normalizedFieldsArgValue.value;
147
147
  knownObjectsAndInterfaces.forEach((def) => {
148
- if (def.interfaces?.some((i) => i.name.value === typeDef.name.value)) {
148
+ const defIsObjectType = def.kind === Kind.OBJECT_TYPE_DEFINITION ||
149
+ def.kind === Kind.OBJECT_TYPE_EXTENSION;
150
+ if (defIsObjectType &&
151
+ def.interfaces?.some((i) => i.name.value === typeDef.name.value)) {
149
152
  let shouldError = true;
150
153
  const keyDirectives = def.directives?.filter((d) => context.isAvailableFederationDirective("key", d));
151
154
  if (!!keyDirectives?.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theguild/federation-composition",
3
- "version": "0.21.1",
3
+ "version": "0.21.2",
4
4
  "description": "Open Source Composition library for Apollo Federation",
5
5
  "peerDependencies": {
6
6
  "graphql": "^16.0.0"