I am wondering if there is a way to add multiple types to a graphql fragment?

Viewed 18

I want to have a fragment that looks something like this.

fragment RegularUser on Barber | Client {
  id
  username
}

So I can use it in my mutation as follows

mutation Register($options: RegistrationInput!) {
  userRegister(options: $options) {
    user {
      ...RegularUser
    }
    errors {
      field
      message
    }
  }
}

0 Answers
Related