-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I'm experiencing an issue where since moving from Apollo Gateway to Hive Gateway, a custom directive is being called when I wouldn't anticipate it to (and isn't called when using Apollo Gateway). To set a rough scene:
Subgraph 1
extend schema @link(url: "https://specs.apollo.dev/federation/v2.5", import: ["@key"])
directive @auth(scopes: [String!]) on FIELD_DEFINITION
extend type Query {
getPlayerById(id: ID!): Player
}
type Player @key(fields: "id") @key(fields: "internalReference") {
id: ID!
name: String!
internalReference: String! @auth(scopes: ["internal"])
}
Subgraph 2
type Player @key(fields: "internalReference") {
internalReference: String!
someOtherInfo: String!
}
Query
query getPlayerById($id: GUID!) {
getPlayerById(id: $id) {
id
name
}
}
Despite the query above not including the likes of the internalReference
field, I'm finding the @auth
directive attached to the field is being called. I find this is only the case given a key field is referenced across subgraphs. For example, if Subgraph 2
instead keyed on id
instead of internalReference
, the query would work.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working