Closed julianwagle closed 1 year ago
extend type ....
is not working (anymore?) you need to use the @extends
directive. This is really badly documented.
extend type User @key(fields: "id") {
id: ID! @external
username: String @external
reviews: [Review]
}
becomes
type User @extend @key(fields: "id") {
id: ID! @external
username: String @external
reviews: [Review]
}
it looks like extend
is a reserved keyword to extend type from the same schema definition file
@peggyrayzis (sorry for the tagging, but your role at Apollo says "developer experience") is there any one in charge of maintaining the demo repositories with latest version of the server?
Also the Apollo documentation is mentioning this same extend type ....
everywhere. Only in the specs they mentioned this directive
It is actually @extends
for anyone trying out @extend
and it's not working.
@extends
works fine! This information saved my life.
For anyone that doesn't want to change the code use the below versions in the parent-level package.json:
"dependencies": {
"@apollo/gateway": "^0.28.1",
"apollo-server": "^2.24.1",
"graphql": "^15.5.0"
}
and the below in each of the services' package.json:
"dependencies": {
"@apollo/federation": "^0.25.0",
"apollo-server": "^2.24.1",
"graphql": "^15.5.0"
}
I'm assuming the above errors are thrown because the package.jsons are using "latest" when they should be locked down to v1 when this demo was written. Federation v2 was just released and I'm assuming these package.jsons are pulling down v2. My versions aren't the latest for v1 but will at least make their code functional.
Environment: MacOS Node Version 14.17.6
Full error log: