I have a federated architecture, I am updating our gateway from v0 to v2 (there is no v1)
Currently I am getting a field that has an argument attached to it (optionally used) from another federated service as external and gateway IntrospectAndCompose composition complains about it
E.g:
Service 1:
type A @key(fields: name) {
name: String
options(test: String): Options
}
type Options {
code: Int
}
Service 2:
extend type A @key(fields: name) {
name: String @external
options(test:String): Options @external
newField: Int @requires(options { code } )
}
So above in my Service 2 the newField
field requires code
from the nested object defined in Service 1 to resolve it
But with the above syntax I get an error saying I cannot pass options field (which has code within it) as it has an optional argument attached to it
Side Notes:
- Gateway was not complaining about this in v1 - it could be because now v2 is more accurate in surfacing errors but in practice this configuration was working fine
-
option(test:String): Option @external
the argument in Service 2 (test:String) was added after the upgrade since composition service was complaining about not having this argument
Field “typeA.options” is missing argument “typeA.options(test:)” in some subgraphs where it is marked @external