I was wondering if there's a way to share the common fields between Input and Type in GraphQL so that I don't have to define the same set of fields in multiple places.
Example:
input PersonInput {
id: String!
name: String
address: String
}
type Person {
id: String!
name: String
address: String
}
I know Fragment might be a solution, but if my understanding is correct, using Fragment always requires you to put an ON condition which makes it look like this:
Fragment PersonCommonFields on Person {
...
}
There seems to be no way to specify "on Person/PersonInput".