
Body union type:
I am getting the error "GraphQLError: Cannot query field \"url\" on type \"TextAttributes\"" even if we have inline fragments in the query ( ...on Text {}, ...on Image {})
Obviously, that the issue here comes from attributes field name which is defined for both types - Text and Image and seems that for some reason it looks for Image.attributes.url in Text type as well.
My question is : is that _GraphQL Apollo Server_ union type limitation ( when union types contains same field name but with different type ) or I'm missing something and some piece of schema def is wrong ?
NOTE: if I rename the attributes field name to be unique foe each union type, it works fine.
UPDATE : This issue is produced only when using Apollo Federation , the query is executed against the Apollo's Gateway which expose the data from different underlying data services.
If we send the same query agains the particular underlying service - it works fine without any errors.
Any update on this? Also causing a problem here.
This is 100% an issue with apollo gateway. If you run the query on just your underlying data service it works fine with the unions. However, if you run it using federation and against the gateway it fails. It seems that the federated global graph is the issue.
Hello! Can @nialloc9 or @IvayloAndonov please paste the specific versions of @apollo/gateway and @apollo/federation are in use here? The gateway is the most important, and I'd love to know what version is resolved (yarn.lock or package-lock.json). Thanks!
Hello @jhampton , thanks for your response!
"^0.11.2", resolves to version "0.11.3" in yarn.lock ( data service package )"^0.10.8", resolves to version "0.10.9" in yarn.lock ( gateway package )@IvayloAndonov Thanks for opening this issue. Can you put together a _runnable_ reproduction (e.g. a GitHub repository that can be cloned, or a CodeSandbox/Glitch) that demonstrates this problem?
Seems to have been patched in @apollo/gateway: "0.14.0"
Most helpful comment
Seems to have been patched in
@apollo/gateway: "0.14.0"