You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shippingEstimate should have size, weight and sku
and simpleShippingEstimate should only have sku available to it.
Unfortunately, they both get everything. This way programmers can make mistakes that can't be caught with types, unit tests, and would force us to write higher level graphql tests - but the problem is that I don't really want to test the connection between type definition in the schema and it's implementation through queries. In this service I might not even have a query that returns a Product - I might only want to extend a Product that's defined and exposed somewhere else.
I've actually made a tool for that - https://github.com/xolvio/federation-testing-tool , (which would dynamically create a _getProduct query for testing environment, among other things) but I really would rather not use it :-) it's useful for things like workshops, libraries, or more low level code, but for just making resolvers and testing them, I'd prefer to stick with types and unit tests. The way your fantastic tooling allows me to do with pretty much everything else :)
Is this on the roadmap? Do you guys agree that this is a problem? I could try to work on this, maybe with little help.
Thanks!
The text was updated successfully, but these errors were encountered:
Describe the bug
The field resolvers types generated for federated types have too many things available on the parent object.
To Reproduce
I've shown some examples here:
https://codesandbox.io/s/fancy-wave-74cxh?file=/ProductResolvers.ts
Basically, for this schema:
shippingEstimate
should havesize
,weight
andsku
and
simpleShippingEstimate
should only havesku
available to it.Unfortunately, they both get everything. This way programmers can make mistakes that can't be caught with types, unit tests, and would force us to write higher level graphql tests - but the problem is that I don't really want to test the connection between type definition in the schema and it's implementation through queries. In this service I might not even have a query that returns a Product - I might only want to extend a Product that's defined and exposed somewhere else.
I've actually made a tool for that - https://github.com/xolvio/federation-testing-tool , (which would dynamically create a _getProduct query for testing environment, among other things) but I really would rather not use it :-) it's useful for things like workshops, libraries, or more low level code, but for just making resolvers and testing them, I'd prefer to stick with types and unit tests. The way your fantastic tooling allows me to do with pretty much everything else :)
Is this on the roadmap? Do you guys agree that this is a problem? I could try to work on this, maybe with little help.
Thanks!
The text was updated successfully, but these errors were encountered: