Federating Input Types

Hello,

I’ve been working on a federation solution for my company, and was asked if it is possible to set up federated input types, or if not what the best approximation would be.

For example, I have two graphs that I federate, accounts and locations. Here’s the graph for accounts:

input AccountInsert {
  accountName: String
  site: String
  locationId: Guid
}

type Account{
  accountId: Guid
  accountName: String
  website: String
  location: Location
}

extend type Location @key(fields:"locationId"){
	locationId: Guid @external
}

type Query{
  account(accountId:Guid):Account
}

type Mutation{
  addAccount(account:AccountInsert!):Account
}

Here’s locations:

input LocationUpsert {
  locationId: Guid
  address: String
  city:String
  state: String
  zip: String
}

type Location @key(fields:"locationId"){
  locationId: Guid
  address: String
  city: String
  state: String
  zip: String
}

type Query{
  location(locationId:Guid):Location
}

type Mutation{
  upsertLocation(location:LocationUpsert!):Location
}

These two graphs federate such that users can call account and retrieve location from the location graph in the federated query account(accountId:$accountId){location{locationId}}. But to add an account with a location, even on the federated graph, they have to run upsertLocation, then use the retrieved locationId to run addAccount.

What I’d like is to update addAccount to include a reference to LocationUpsert so that we can resolve the location reference through addAccount, and have the federated graph direct the mutation to locations. Is this possible without building a separate reference to LocationUpsert in the account graph and resolving it there? If so, how can we accomplish this?

Thanks!