graphql-hive / graphql-hive/console

Schema checks with changes in multiple services don't reflect the changes for other services

Open
#3,754 0 comments 0 reactions 0 assignees View on GitHub
registry
Dominant language
TypeScript
Stars
483
Forks
145
Avg merge
2d 5h
Merged PRs (30d)
65

Description

Hi, we're running into a small issue with schema checks in our GitHub PRs. When we add a type to one subgraph with Federation and then add the same type to another subgraph (so it can contribute fields to the same type), in the same PR, we receive the following error:

> Field "AuditLog.employeeNumber" is marked `@external` on all the subgraphs in which it is listed (subgraph "service2").

I understand if we split this into two PRs, one after the other, it would work fine, because the type would already exist in the supergraph and the validation would pass. Any thoughts on how to resolve this? Provided our command and schemas below. Thank you!

`hive schema:check "services/service1/graphql/service1.graphqls" --service=service1 --github`

service1.graphqls

```graphql
type AuditLog @key(fields: "logId"){
logId: ID!
description: String!
employeeNumber: Int!
}
```

`hive schema:check "services/service1/graphql/service2.graphqls" --service=service2 --github`

service2.graphqls

```graphql
type AuditLog @key(fields: "logId") {
logId: ID!
employeeNumber: Int! @external
employee: Employee! @requires(fields: "employeeNumber")
}
```

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.