Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server shouldn't look for a parameterized @external resolver method #781

Open
gzak opened this issue Mar 5, 2024 · 0 comments
Open

Server shouldn't look for a parameterized @external resolver method #781

gzak opened this issue Mar 5, 2024 · 0 comments
Labels

Comments

@gzak
Copy link

gzak commented Mar 5, 2024

Issue Description

Take a look at the following example in the Apollo documentation.

Currently, the server would expect a set of classes as follows:

class Product {
  id, shippingEstimate; // lazy shorthand
}

interface IQueryResolver {
  Product someRootResolver(...);
}

interface IProductResolver {
  Integer weight(Product product);
}

But it should not expect a separate resolver method for the weight field since it is marked @external, meaning this subgraph cannot resolve it. Instead, it should just expect a plain old weight field as part of the Product class, and assume that some other subgraph will resolve it:

class Product {
  id, weight, shippingEstimate; // lazy shorthand
}

interface IQueryResolver {
  Product someRootResolver(...);
}

The field is needed so that the entity resolver can fill in the result of the external weight resolver into the Product model, and also so that this subgraph can read it during subsequent query processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant