I am fairly new to GraphQL and i am writing a schema which will include companies and users. Each of these entities will have a mailing address associated with them. I am also using AWS Amplify to generate the resolvers and the DB (at least to get the project going).
Here's an abbreviated version of what I started
type Address {
id: ID!
streetAddress1: String!
streetAddress2: String
city: String!
state: String!
zipCode: String!
country: String!
coordinates: String
}
type Company
{
id: ID!
name: String!
address: Address!
...
}
My question is whether it is best to have the address as a separate type in my schema or to lump each of the company/user types with their own address? These are my concerns though
Figured I would use an Address
type without @model
annotation and no @connection
from the types that require it.