Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure there's a Query node before trying to add a field to it.
Federation adds some queries to the schema. There already existed code to insert a Query node if none existed previously. But that code was only put on addEntityToSchema(), and not the other place we update the query, addServiceToSchema(). Almost always the old code was good enough, since we call addEntityToSchema() before addServiceToSchema(). But there's on exception: when the schema has no `@key`. In that case we only call addServiceToSchema(), so we need to do the query-existence check there too.
- Loading branch information