Understanding the basic rules of federation
At the time of writing this book, there are no official federation specifications; however, there are some rules that are common across the different federation solutions available. Let’s go through these rules in a question-and-answer format.
How do you merge different types?
Merging types with different type names results in a schema with all the types. So, let’s say that in one schema you have an Animal
type:
type Animal{ name: String! }
And in the other schema, you have a Car
type:
type Car { name: String! }
Then the resulting merged schema will include both:
type Animal{ name: String! } type Car { name: String! }
To simulate how schemas are merged with the federation process, we will use a small script from the GitHub chapter repository. Follow these steps:
- Clone the book repository and enter the
chapter-07
folder inside your IDE command line...