Extend shareable object in Apollo GraphQL Federation v2

Extend shareable object in Apollo GraphQL Federation v2


0

Hi guys I have a question, I can’t solve this: I have a shared object between multiple subgraphs. In one subgraph I need to add 2 more fields to this shared object. I tried using "extend" but it’s not working, rover is giving me error when composing.

I tried this

schema1.graphql

type GenericResponse @shareable {
  "Set true false for the response of the API"
  success: Boolean!

  "Error Code of the message"
  errorCode: String

  "Human Readable Error Message"
  errorMessage: String
}

schema2.graphql

type GenericResponse @shareable {
  "Set true false for the response of the API"
  success: Boolean!

  "Error Code of the message"
  errorCode: String

  "Human Readable Error Message"
  errorMessage: String
}

extend type GenericResponse {
  "Remaining login attempts"
  remainingLoginAttempts: Int

  "Default lock out time"
  defaultLockOutTime: String
}

Is it possible to reuse the shared object? or should I create a new object with a different name? thanks for your help


Load 3 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *