Skip to content

Use external and requires in base type #1565

Answered by dariuszkuc
hchen asked this question in Q&A
Discussion options

You must be logged in to vote

In general, the expectation was that you should not define @external fields on the base type -> given a type you would extend its functionality in other subgraphs. In your case, you would compute shippingEstimate in the subgraph that calculates the weight. I think that is generally an anti-pattern.

That being said, I think that would still be a valid graph for the composition so we probably should remove this check. Also with the smart type merging introduced in Fed v2, @extends / extend type is no longer necessary so it might be hard to distinguish between base and extended type anyway.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants